I’ve had a few people ask me in the past few days how to disable external accounts as part of their workflow for summer deployments. While I think that external accounts are a great add to the admins toolkit I understand that it doesn’t fall into everyone’s logic that they have for their environment. To disable them: defaults write /Library/Preferences/com.apple.loginwindow EnableExternalAccounts -bool false
-
-
Login & Logout Hooks
If you want to have a script run when a user logs in and/or logs out then you’ll likely want to look into using login and logout hooks. A hook is a script that runs as root (although you can execute as the user with su). Hooks are enabled in the /var/root/Library/Preferences/com.apple.loginwindow. You can do so using defaults, writing the path to the script into LoginHook as a string as follows: defaults write com.apple.loginwindow LoginHook /scripts/script.sh If you only want to run the script once (ie – at first login) then you can end the script with a defaults command that will then reset the field. defaults write com.apple.loginwindow LogoutHook…
-
Disable Automatic Login Programatically
Automatic logon can be enabled for Windows, or Mac OS X. We already discussed disabling automatic logon using a script for Windows, so let’s look at doing so for Mac OS X. The variable that controls automatic logon is stored in /Library/Preferences/com.apple.loginwindow.plist in the autoLoginUser key. By default automatic logon is disabled and so you can simply delete that key to disable it, which you can do with the following command: defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser You can also enter an autoLoginUser into the field to define the user who will automatically be logged in. You may remember that the loginwindow defaults domain is the same location that login hooks are…