Enable Guest Account on AD joined Mac

New Contributor III

Hi all,
my question:
how do i activate with CLI the guest account on a macOS Catalina that has an AD join?
i had tried with:
defaults write /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -bool YES and
dscl . -create /Users/Guest

on the login window I see the user and password window.
I type guest and enter but the login fails

any idea?


New Contributor III

Hi @ivanlovisi ,

is there a hidden Management Account? That was the problem why the guest user was not displayed on my devices.

my script:


Enable Guest Account

defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool TRUE

show Guest Account in the Login Window

defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool FALSE

Hide Management Account from the Login Window

dscl . create /Users/MANAGEMENTACCOUNTNAME IsHidden 1

Does that work for you?

New Contributor III

Ran into this issue myself.. modifying the OS version check in the following script got it working for me in Big Sur (11.5.2):