Skip to main content
Solved

Unhide/Delete a User Account?

  • October 10, 2016
  • 4 replies
  • 32 views

Forum|alt.badge.img+8

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)

Best answer by franton

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

4 replies

Forum|alt.badge.img+23
  • Esteemed Contributor
  • Answer
  • October 11, 2016

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

Forum|alt.badge.img+8
  • Author
  • Valued Contributor
  • October 11, 2016

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


Forum|alt.badge.img+2

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


Forum|alt.badge.img
  • New Contributor
  • February 2, 2024

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