I got it figured out. In case someone else needs this at some point here is my final script.
sudo dscl . -create /Users/sub
sudo dscl . -create /Users/sub UserShell /bin/bash
sudo dscl . -create /Users/sub RealName sub
sudo dscl . -create /Users/sub UniqueID 1001
sudo dscl . -create /Users/sub PrimaryGroupID 20
sudo dscl . -create /Users/sub NFSHomeDirectory /Users/sub
sudo createhomedir -u sub -c
sudo dscl . -passwd /Users/sub becker
I would also note that dscl is nearing deprecation as a user creation technique. sysadminctl has an -addUser switch that requires fewer steps and can avoid some of the pitfalls of dscl. You might also want to use sysadminctl to get a secure token for the account created.
You can also just create a jamf policy with a custom trigger to create the user and then call it with a one-liner in your script with
this post was written in error, I have no knowledge of jamf schools... my mistake
You can also just create a jamf policy with a custom trigger to create the user and then call it with a one-liner in your script with
this post was written in error, I have no knowledge of jamf schools... my mistake
Hmmm....this is something I have never done before. Can you give some
better directions?
Megan Ramola
Technology Assistant
Becker School District
763-261-4501 ext 3153
I would also note that dscl is nearing deprecation as a user creation technique. sysadminctl has an -addUser switch that requires fewer steps and can avoid some of the pitfalls of dscl. You might also want to use sysadminctl to get a secure token for the account created.
Yes - I did read that dscl was heading out the door, I just needed to get
it to work at least once, and then I can make some changes. If you have a
full script using sysadminctl that you'd like to share that would be
great. I am very new to all of this.
Megan Ramola
Technology Assistant
Becker School District
763-261-4501 ext 3153
Hmmm....this is something I have never done before. Can you give some
better directions?
Megan Ramola
Technology Assistant
Becker School District
763-261-4501 ext 3153When I wrote that, I thought you were using Jamf Pro,
I have not used Jamf school, so I do not know if that's an option for you.
On Github there is a script that utilizes sysadminctl called mkuser made by Pico. I haven't used it myself yet, but it's another option and is well documented.
https://github.com/freegeek-pdx/mkuser