Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

The Apple-Menu shows Sleep, Restart..., Shut Down... elements for all users. I would like to be able to prevent users from shutting down the system or from restarting the system. While a Restart... may not be result in only temporary downtime, a Shut Down... would lead to a downtime until someone has physical access to the machine.

share|improve this question
1  
Why do these users have a system account on the server? –  Gerry Jan 2 '12 at 10:37
    
For the interop with the CIFS / SMB shares, there need to be users against who can be authenticated. Additionally due to the Mac mini's form factor, it can easily provide a thin-client (via RDP) to a Windows XP Virtual Machine. (Thereby removing an additional laptop that was used as a thin client) –  angerman Jan 2 '12 at 20:36
    
You should create them as directory users instead. –  Gerry Jan 2 '12 at 21:11
    
Yes, that would allow them to be Users for the shared folder only. But then the mac mini could not be used as a thin client as well. I much appreciate your comments, but it's not a feasible solution to not use the mac mini as a thin client in the current setup. Thus I need to be able to prevent users from Sleeping, Restarting or Shutting Down the machine. –  angerman Jan 3 '12 at 7:31
add comment

2 Answers

I've removed shutdown for my lab Macs on OS X Lion. The two commands that should accomplish this are:

sudo defaults write /Library/Preferences/com.apple.loginwindow ShutDownDisabled -bool true
sudo defaults write /Library/Preferences/com.apple.loginwindow ShutDownDisabledWhileLoggedIn -bool true

I've not had 100% success with them, so I've also edited the interface file at: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Resources/English.lproj/StandardMenus.nib/objects.xib

If you want to remove the Sleep and Shut Down options, look for the following id's in object and reference tags. Delete the entire object, one for the Sleep option and two for the Shut Down option, and each of the references.

id's: Sleep - 236 Shut Down - 238, 285

Source: http://rustyisageek.blogspot.com/2012/06/editing-apple-menu.html

Edit: I've been told that when these settings are applied with MCX, they work as expected!

share|improve this answer
add comment

When I removed the objects completely the Finder kept crashing. So I merely changed the command issued by the menu to be the same as "About This Mac"! Works a treat. I suspect a system update might revert it as some stage though.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.