Posted on 09-21-2016 11:29 AM
Hi everyone,
I am not the greatest at creating scripts. I was wondering if any of you could assist with a small management script I want to create.
I need a script to look for a local account on a computer. If the account is missing, it will create it. If the account is there, reset the password to a given entry.
Thank you all in advance for any assistance on creating this script!
Posted on 09-21-2016 11:47 AM
We use something along these lines to create the admin account (and we use a JSS Policy Local Accounts payload to reset it).
/bin/mkdir -p /private/var/${adminAccount}
/usr/sbin/sysadminctl -addUser ${adminAccount} -fullName ${adminAccount} -UID ${adminUID} -password "${adminPassword}" -home "/private/var/${adminAccount}" -admin
/usr/sbin/chown ${adminAccount} /private/var/${adminAccount}