Refreshing Login Banner message?

fgonzale
Contributor

How do I force a login banner message to refresh?

Basically I have a script that checks to see if all my policies have completed and if they have it then writes a message to the login banner using the following:

defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Enter your credentials"

Once the message appears ideally this would tell our field techs that the machine is ready for people to log in and that all policies have completed.

However after the defaults write /Library/Preferences/com.apple.loginwindow command runs no message shows up at the login window.

If I log in and then logout (or restart the machine) the message shows up but the policy that writes the login banner message runs in the background when nobody is logged in.

Ideally I would like the message to show up after I send the defaults write /Library/Preferences/com.apple.loginwindow command without having to reboot or physically log into the machine.

Is there a background process I can restart to make this happen?

1 ACCEPTED SOLUTION

fgonzale
Contributor

solution:
In that same script I added a command to restart the loginwindow process. This causes the login screen on a logged out Mac to momentarily black out and it returns with the new login banner text.

#!/bin/bash
#Will check for basic policy deployment completion and if so will write a Banner Message at the login "Please login with your credentials"

#body of script that checks for completion of policy tasks...if statements abound...

#banner message writeout
defaults write /Library/Preferences/com.apple.loginwindow.plist LoginwindowText "Please login with your credentials"
sleep 1
killall -HUP loginwindow

View solution in original post

1 REPLY 1

fgonzale
Contributor

solution:
In that same script I added a command to restart the loginwindow process. This causes the login screen on a logged out Mac to momentarily black out and it returns with the new login banner text.

#!/bin/bash
#Will check for basic policy deployment completion and if so will write a Banner Message at the login "Please login with your credentials"

#body of script that checks for completion of policy tasks...if statements abound...

#banner message writeout
defaults write /Library/Preferences/com.apple.loginwindow.plist LoginwindowText "Please login with your credentials"
sleep 1
killall -HUP loginwindow