LoginWindowScripts | Apple Developer Documentation Archived: 2026-04-05 13:09:54 UTC Device Management LoginWindowScripts Device Management Profile The payload that configures scripts to run at login and logout. macOS 10.7+ object LoginWindowScripts Properties An array of one or more dictionaries of scripts to run at user login time. An array of one or more dictionaries of scripts to run at user logout time. If true , the system doesn’t execute the login scripts during login. If true , the system doesn’t execute the logout scripts during logout. Discussion Specify com.apple.mcxloginscripts as the payload type. The MCX login and logout managed-scripts payload contains information about executable scripts that can run at user login and logout. To use this payload, set EnableMCXLoginScripts to true in /var/root/Library/Preferences/com.apple.loginwindow.plist ; otherwise, the system ignores this payload. Loginwindow uses the LoginHook and LogoutHook string keys in /var/root/Library/Preferences/com.apple .loginwindow.plist to indicate a path to the executable script files, which run during user login and logout. The system passes the current user name as an argument to the file. Profile availability Device channel macOS User channel NA https://developer.apple.com/documentation/devicemanagement/loginwindowscripts Page 1 of 3 Allow manual install macOS Requires supervision NA Requires user-approved MDM NA Allowed in user enrollment NA Allow multiple payloads NA Profile example ?xml version="1.0" encoding="UTF-8"?> PayloadContentloginscriptsfiledata ExampleDfilenameping.shskipLoginHookskipLogoutHookPayloadIdentifiercom.example.myloginwindowscriptspayloadPayloadTypecom.apple.mcxloginscriptsPayloadUUID2bcd5563-f44d-4f74-b706-050a628c0cafPayloadVersion1 https://developer.apple.com/documentation/devicemanagement/loginwindowscripts Page 2 of 3 PayloadDisplayName Login Window Scripts PayloadIdentifier com.example.myprofile PayloadType Configuration PayloadUUID 5cbf617d-16a5-4564-ba2c-728fd7f7d732 PayloadVersion 1 Current page is LoginWindowScripts Source: https://developer.apple.com/documentation/devicemanagement/loginwindowscripts https://developer.apple.com/documentation/devicemanagement/loginwindowscripts Page 3 of 3