Mac – power off multiple Macs everyday at 23:30 (11:30 pm)

macscriptshutdown

I have this problem in my office that multiple Macs always run 24/7 and my boss said that I need to make it stop. Now I don't have much experience with Macs, I'm more the Windows type.

I have one Mac who acts as a server and would like to run a script or something like that to orchestrate the power status of several computers if that helps.

How can I shut down all of those 7-8 Macs remotely at 11:30pm?

Best Answer

As patrix has pointed out in a comment, you can set up any Mac to start up or wake up, and sleep or shut down at specific times, via the System Preferences -> Energy Saver -> Schedule... settings.

You could also try using AppleScript, e.g. this code (edit it with Script Editor, then save as an Application):

tell application id "com.apple.systemevents" -- System Events.app
    shut down
end tell

And then use OSX's Launch Services to run this script at a given time. To set this up, you could use a free tool such as "Lingon X".

Besides, why shut them down like this? If all you care about is to preserve electrical power, why not instead set up the Macs to go to Sleep after being idle for, say, 30 minutes? That way, they will go to sleep much sooner usually, saving more power. If they do not go to sleep as expected, you can check with the Terminal command pmset -g what might prevent them from sleeping. Often it's a pending print task (which you may want to delete, then) or mounted server volumes.