Hello, I've been asked to push a script to select Macs that causes them to automatically login to the guest account.
I've got a working script (below) to write to the necessary keys. However I've run into a really weird case where System Preferences shows the guest account is enabled and selected for auto login, however when I reboot I land at the login screen. I'm testing on a MacBook Air 13" that I internet recover between tests.
printf "$appName $(date): Enabling guest account... \n" sudo defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess -bool true sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -bool true printf "$appName $(date): Done. \n" printf "$appName $(date): Setting Guest account to auto-login\n" defaults write "/Library/Preferences/com.apple.loginwindow" GuestEnabled -bool true defaults write "/Library/Preferences/com.apple.loginwindow" autoLoginUser "Guest" chmod 644 "/Library/Preferences/com.apple.loginwindow.plist" printf "$appName $(date): Done.\n"