Skip to main content

If I create a hidden account with the JAMF binary below, how can I delete the account or how can I unhide it?



This is how I create it:



sudo jamf createAccount -username localadmin -realname Local Admin -password P@ssw0rd -admin -hiddenUser


This creates an account in /private/var/localadmin



I have then tried to change the ID and or deleting it with DSCL, but I keep getting an error.



sudo /usr/bin/dscl . -delete /private/var/localadmin

delete: Invalid Path
<dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)

That's because where the user account is in the database is not where the folder itself is located!



Try the following:



sudo /usr/bin/dscl . -delete /Users/localadmin

Doh! You're right @franton. I thought all hidden users went into /private/var in the database also. Thanks for setting me straight.


Just came across this thread and it's saved what little hair I have from being ripped right out. I'm new to JAMF and scripting, so thanks for the script.



Thanks


Trying too delete user/admin account, which took over my admin control, in terminal and it wants a password


Reply