Skip to main content
Solved

Create new user using command line

  • July 11, 2024
  • 1 reply
  • 0 views

Forum|alt.badge.img+5
  • Contributor
  • 28 replies

Hi, 

 

How can I create new admin user using command line and user home will be delete automatically when remove from System Preferences?

I successfully create new admin user using the following command but when I delete this user from system preferences the home folder will not delete automatically compare to users create manually from system preferences.

Any advice?

Thank you

sudo sysadminctl -addUser Admin -fullName "Admin" -password admin123 -home /Users/admin -shell /bin/zsh -admin

Best answer by sdagley

@yjian Have you tried using the sysadminctl command without the -home option? Specifying the home directory is optional, and if you do specify a home path instead of allowing the sysadmin to create a home directory in the default location (which is what you appear to be trying to do) it may be treated differently when it comes to deletion.

View original
Did this topic help you find an answer to your question?

1 reply

sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3536 replies
  • Answer
  • July 11, 2024

@yjian Have you tried using the sysadminctl command without the -home option? Specifying the home directory is optional, and if you do specify a home path instead of allowing the sysadmin to create a home directory in the default location (which is what you appear to be trying to do) it may be treated differently when it comes to deletion.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings