Is there any way to remotely make a Mac which is powered on – but locked – to go to sleep and/or shut down? If so, how?
Motivation: See this question.
E.g. can I use another Mac B to login via screen sharing to Mac A even if it's locked, and shut it down? Or can I use some other tool, like a remote Alfred script that can execute in the background even if the target computer is locked?
For this question, we are assuming that I am an administrator and have the login details to the target computer.