Energy Saver - Hard Disk Sleep

applesupport-ne
New Contributor III

I would like to apply a policy to all my machines in order to deselect " Put Hard Disks to sleep when Possible" for some reason the policy failed in the middle of deployment:

Executing Policy HD No Sleep...
Running script HD No Sleep...
Script exit code: 0
Script result: Fail (10)

This is my script that i used from "Extension Attribute"

1db1bb950e03460ea2c77d31ee7112ba

2 REPLIES 2

Look
Valued Contributor III

As I understand it disksleep is not a binary value, it's the number of minutes before the event.
Anything other than 0 or no value is true.

mm2270
Legendary Contributor III

You need to actually edit the first line that states it needs to be edited to a value you want it to check on.

For example, if you want all your Macs to have disksleep to be enabled and set to a value of 10, then edit the line that says:

desiredValue="EditFromTemplate_Desired_Value_-_Example:_false"

to

desiredValue="10"

When the EA script runs, if the Mac's hard disk sleep setting is set to 10 (minutes), the result will show up as:

Pass (10)

EDIT: Also, I hope you weren't using the above script as a way to actually set the disksleep value. That script is just an Extension Attribute script, so it pulls in a value during inventory collection. Its not going to set anything on the Mac. There is the concept of an "Active EA" where you can make the script take an action if something isn't set correctly. I would personally keep the 2 items separate myself, but you could modify it to change the pmset disksleep value if you wanted to.