Image: Anil Bolukbas / Getty Images

As administrators, sometimes we’re charged with performing tasks that we’ve performed countless times but with a twist that makes the task more difficult. I encountered one such issue recently at a site hosting multiple Mac servers.

Due to a number of rolling power-related issues, the servers went offline and stayed offline even after power was restored. Typically, this would not be much of a concern given the staff present to resolve any issues on-premises, but COVID-19 has impacted business operations in such a way that these devices were not immediately accessible.

SEE: Apple iPad Pro 2020: Cheat sheet (free PDF) (TechRepublic)

The solution to this was to set the power-on functionality for each device to check that device is powered on each day at a specific time. If off, the system will power itself on at the specified date and time. Another setting that works well in conjunction is the power on after a power outage. When combined, both will work to ensure devices are powered on after power is restored and on a regularly scheduled basis, so devices aren’t offline too long after an outage.

How to power-on devices by schedule

  1. Log into the Mac with administrative credentials.
  2. Launch Terminal.
  3. Enter the following command to configure the device to power on each day at 8 a.m.:
pmset repeat wakeorpoweron MTWRFSU 08:00:00 

By modifying the days and time, schedules can be customized to meet the needs of the organization. Note: The use of military time.

How to set a device to power-on after an outage (MacBooks only)

  1. Log into the Mac with administrative credentials.
  2. Launch Terminal.
  3. Enter the following command to configure the device to restart after power loss:
sudo systemsetup -setrestartfreeze on 

Note: This command is only supported on mobile devices, such as the MacBook line, not the desktop line of computers.

How to set a device to power-on after an outage (non-MacBooks only)

  1. Log into the Mac with administrative credentials.
  2. Launch Terminal.
  3. Enter the following command to configure the device to restart after power loss:
sudo systemsetup -setrestartpowerfailure on 

Note: This command is only supported on desktop devices, such as the Mac mini and iMac, not the mobile line of computers.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays