Category filter
Script to customize Login window on Mac
The login window has several settings, including selecting the user login and power options like shutdown, restart, and sleep. Organizations may need to hide the user list or disable the power options on the login page to ensure the enterprises’ security. You can remotely execute custom scripts to customize the login window on macOS devices.
Scripting language – Bash
File extension – .sh
Display the list of users in the Login window
1 |
defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME false |
The command will display all the user accounts available on the device except the hidden ones on the login window.
Display the username and password dialog box on the Login window
1 |
defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME true |
The command will display the username and password dialog box prompting the user to enter the credentials of the user account they want to log in to.
Hide Shut Down icon from the Login window
1 |
defaults write /Library/Preferences/com.apple.loginwindow ShutDownDisabled true |
The command will hide the Shut Down option from the login window barring any user from shutting down the device from the login window.
Hide Restart icon from the Login window
1 |
defaults write /Library/Preferences/com.apple.loginwindow RestartDisabled true |
The command will hide the Restart option from the login window barring any user from restarting the device from the login window.
Hide Sleep icon from the Login window
1 |
defaults write /Library/Preferences/com.apple.loginwindow SleepDisabled true |
The command will hide the Sleep option from the login window barring any user from putting the device on sleep mode from the login window.
Replace ‘true
’ with ‘false
’ for enabling shutdown, restart and sleep icons in the login window.
Display a message on the Login window
1 |
defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "text" |
Replace ‘text
’ with the required message to be displayed. If the script contains an exclamation mark, it will fail to execute. For instance, if you replace text with ‘Your device is visible to the administrator’: