Energy Server and MCX

Not applicable

Hey Guys,
Wondering if anybody has gotten Energy Saver settings to work using MCX.

Thanks
Larry

30 REPLIES 30

talkingmoose
Moderator
Moderator

The JSS has a few templates for energy saving settings. They're all under
On 4/1/11 9:34 AM, "Larry Cutrell" <larrycutrell at gmail.com> wrote:
com.apple.MCX but search for "energy".

These are my settings for Desktops:

Apply Setting To: System Level Enforced
Domain: /Library/Preferences/com.apple.MCX
Key: com.apple.EnergySaver.desktop.ACPower-raw
Value:

<dict> <key>Automatic Restart On Power Loss</key> <integer>0</integer> <key>Disk Sleep Timer-boolean</key> <false/> <key>Display Sleep Timer</key> <integer>30</integer> <key>Sleep On Power Button</key> <integer>0</integer> <key>System Sleep Timer</key> <integer>0</integer> <key>Wake On LAN</key> <integer>1</integer> <key>Wake On Modem Ring</key> <integer>0</integer>
</dict>

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

Bukira
Contributor

Yes but only via WGM

Criss Myers

Not applicable

So no go with Casper?

LC

dmcmillen
New Contributor II

Haven't tried it, but what about a policy script to run pmset regularly? Kludgy but would likely work.

Regards,

Drew McMillen, Desktop Engineering Team Lead
NIEHS Tech Services Team
(w) 919/313-7683
(m) 919/257-8333
mcmillen at niehs.nih.gov
https://apps.niehs.nih.gov/itsupport/web

Bukira
Contributor

Probabaly can. I can send u my plist on Monday

Criss Myers

CasperSally
Valued Contributor II

We used pmset once and then lock out energy saver preference panel with mcx.

Janowski
New Contributor II

We don't go through MCX, but there is a computer "User Environment" setting in composer for energy saver that we've had success with.

ben janowski
Senior Macintosh Support Technician
Kohl's Mac Support Team
262.703.1396 | benjamin.janowski at kohls.com

tlarkin
Honored Contributor

I use pmset as well. You could use pmset to set the settings then use the strings command to view the plist to see what strings have been aded or modified and then use that to set MCX settings.

Not applicable

When I search for "energy" I get No matches for "energy".
I am on 8.0 is this something new in 8.1?

-Wi11

talkingmoose
Moderator
Moderator

We're on 7.31 still. Not sure about 8.0 and later.

In the JSS I'm going to Management tab --> Managed Preferences ---> Create Managed Preference --> Create from Template and searching for "Energy". I can also browse them under com.apple.MCX.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

Matt
Valued Contributor

I actually just push a PMSET bash script. Is the MCX better?

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

talkingmoose
Moderator
Moderator

MCX's advantage is that it's centrally managed. You set the preference in
On 5/19/11 6:23 PM, "Matthew Lee" <Matt.Lee at fox.com> wrote:
one location and then the settings propagate to machines as they phone
home for policies.

If a script works for you equally as well then nothing wrong with that
approach.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

talkingmoose
Moderator
Moderator

MCX can be tricky.
On 5/23/11 12:25 PM, "Matthew Lee" <Matt.Lee at fox.com> wrote:

Application preferences that can be managed by MCX are straight forward
because they all live in ~/Library/Preferences. Mac OS X preferences are
kind of bizarre sometimes. You eventually learn some have strange
locations. And some, like keyboard settings, are a nightmare to trudge
through because the keys aren't descriptive at all. They're numbers. And
there are dozens.

Use a tool like BBEdit if you have it or TextWrangler (free) to view, edit
can compare .plist files. Quite often I can tell a setting is in a
specific file but the key/value pair may be obscured or nonexistent until
it is set. TextWrangler will let you compare two files and see the
changes. It's a very efficient way of finding what you need.

So far, MCX can't control domain searches. I really wish it could. I use a
script calling ARD's "networksetup" command to set that. Your decision to
try to replace scripts with MCX, however, is a good one. That's what I've
done.

If Casper's MCX settings stick on a machine then you can clear its MCX
cache using:

sudo dscl . -delete /Computers/localhost

sudo rm ­rf /Library/Managed Preferences

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

Matt
Valued Contributor

Those commands just don't seem to be working for me. When the machine reboots and I run a jamf mcx -verbose it still has old settings. Arg! MCX's why!!!!Why!!!!!
--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

tlarkin
Honored Contributor

Look for a com.jamf.mcx.plist or something in managed preferences in
/Library and delete it. You are using Jamf's MCX or OD? I remember
when Casper added MCX support I had to turn off managed preferences in
the framework setting because they were not playing nice with OD
settings.

Matt
Valued Contributor

No OD Server here just Casper.

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

Matt
Valued Contributor

I like this MCX idea however I do not see the option in the JAMF templates on 8.1. Any other way to get the MCX to import or even find it?

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

talkingmoose
Moderator
Moderator

You can always add your own if you don't see it in JAMF's templates. Some
On 5/23/11 10:09 AM, "Matthew Lee" <Matt.Lee at fox.com> wrote:
are easy to find but others are not. I use the Workgroup Manager to find
many of the more obscure system settings like Energy Saver.

These are my settings for Desktop Macs:

Apply Setting To: System Level Enforced
Domain: com.apple.MCX
Key: com.apple.EnergySaver.desktop.ACPower-raw
Value: Enter Manually

<dict>
<key>Automatic Restart On Power Loss</key>
<integer>0</integer>
<key>Disk Sleep Timer-boolean</key>
<false/>
<key>Display Sleep Timer</key>
<integer>30</integer>
<key>Sleep On Power Button</key>
<integer>0</integer>
<key>System Sleep Timer</key>
<integer>0</integer>
<key>Wake On LAN</key>
<integer>1</integer>
<key>Wake On Modem Ring</key>
<integer>0</integer>
</dict>

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

tlarkin
Honored Contributor

What I do is run composer to do a file system diff and then make all my changes in preferences. Then go investigate what changes were actually made and then convert that into MCX. Since, a lot of the items aren't really documented. So, you gotta sort of let the system do it's thing then just see what it did.

-Tom

Matt
Valued Contributor

I'm still learning a lot about MCX's. I noticed that when I did the capture the two files that were edited are located in a SystemConfiguration folder inside the Preferences folder. If I was to edit these plists and upload them to the JSS won't it default to just the Preferences folder? How can I tell it to place these MCX files ion the SystemConfiguration or is there a default MCX where I can apply the keys?

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

talkingmoose
Moderator
Moderator

Once imported into the JSS, set it to System Level Enforced. The Mac OS
On 5/23/11 10:57 AM, "Matthew Lee" <Matt.Lee at fox.com> wrote:
knows where to apply things. You won't necessarily see these changes
reflected in the .plist files when applied, however.

--missing content--

"Enforced" does not create or overwrite the .plist file in the user or
system folders. However, any user or system preference set to "User Level
At Every Login" will literally write to the user's ~/Library/Preferences
.plist file.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

Matt
Valued Contributor

With knowing the below information what is the best way to force the MCX to recompose? Or is it better to just apply User level settings?

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

--missing content--

"Enforced" does not create or overwrite the .plist file in the user or
system folders. However, any user or system preference set to "User Level
At Every Login" will literally write to the user's ~/Library/Preferences
.plist file.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

--missing content--

&quot;Enforced&quot; does not create or overwrite the .plist file in the us
er or<br>
system folders. However, any user or system preference set to &quot;User Le
vel<br>
At Every Login&quot; will literally write to the user's ~/Library/Preferenc
es<br>
.plist file.<br>
<br>
-- <br>
<br>
William Smith<br>
Technical Analyst<br>
Merrill Communications LLC<br>
(651) 632-1492<br>
<br>

talkingmoose
Moderator
Moderator

That depends on what level of enforcement you've chosen. User level items
On 5/23/11 11:55 AM, "Matthew Lee" <Matt.Lee at fox.com> wrote:
recompose at login. System level items recompose at restart. I have,
however, seen some User Level At Every Login items (Extensis plug-ins) not
compose until a restart.

You can only apply user level enforcement to items that are under a user's
control.

If in doubt, restart.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

Matt
Valued Contributor

Appreciate all the help William. It seems like MCX's are a lot harder than they should be. I can't get the key you sent me to work thus far. I am going to keep at. Do you know if their is any way you can set an MCX for search domains, enabling ARD, or should I just leave my bash scripts running. I am trying to get as many scripts converted to MCX's as possible but so far MCX's have been a headache! Even if I disable them they seem to stick no matter what.

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

golbiga
Contributor III
Contributor III

What is your output of mcxquery?

Allen

golbiga
Contributor III
Contributor III

If I create a group that has askForPassword set to 0 instead of 1, that will change upon running sudo jamf mcx -username <username>. Im guessing because you are fully removing the key that you need to delete the MCXSettings altogether to clear up the cache.

You should check out John Detroye's Client Management slides from PSU Mac Admin Conference. http://macadmins.psu.edu/PSUMAC301-MCX-JohnDeTroye.pdf

Also Edward Marczak & Greg Neagle's Enterprise Mac Managed Preferences book is also a really good and quick read.

<http://macadmins.psu.edu/PSUMAC301-MCX-JohnDeTroye.pdf>Allen

Matt
Valued Contributor

Thanks for the help! I am going to check it out. I am still new to MCX's. I used to just script everything but its becoming harder to manage.

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST

golbiga
Contributor III
Contributor III

No problem. I'm still learning myself.

MXC can be a pain but it also has a lot of rewards in the end.

golbiga
Contributor III
Contributor III

Matt,

Just did a test on a mac here. My standard mcx for the screensaver is Enable askForPassword and 600 timeout. I created a Managed Preference Profile that just contained 600 Timeout and the ScreenSaver Module. I was seeing the same thing as you, the option to uncheck ask for password was grayed out. Along with the other two commands, I also ran:

sudo dscl . -delete /Users/<username> dsAttrTypeStandard:MCXSettings

That killed the askForPassword key and on subsequent reboots it has not returned. Hope this helps.

Allen

Matt
Valued Contributor

You are a rock star! I will test this out with my client in a few hours. I wonder if this is a bug?

--
Matt Lee
FNG Sr. IT Analyst / Desktop Architecture Team / Apple S.M.E / JAMF Casper Administrator
Fox Networks Group
matthew.lee at fox.com<mailto:matthew.lee at fox.com>

Need Help? Call the Help Desk at (310) 969-HELP (ext 24357) or online at http://itteam<http://itteam/>
Help Desk Hours: Mon-Fri, 6AM-6PM PST