Category filter
Script to remotely Create User Accounts on macOS devices
Manually creating user accounts on all of your employee devices can be time-consuming, especially if you are an administrator for a large workforce. However, device admins can remotely create admin accounts on their corporate devices with Hexnode’s custom scripting feature.
Scripting Language – Bash
File extension – .sh
Create an Admin User account
1 2 3 4 5 6 7 |
#!/bin/sh export PATH=/usr/bin:/bin:/usr/sbin:/sbin USERNAME= "Daniel" FULLNAME= "Daniel.Hector" PASSWORD="One@Two#8" PASSWORDHINT="One to Eight" sysadminctl -addUser "$USERNAME" -fullName "$FULLNAME" -password "$PASSWORD" -hint "$PASSWORDHINT" -admin |
Create a Standard User account
1 2 3 4 5 6 7 |
#!/bin/sh export PATH=/usr/bin:/bin:/usr/sbin:/sbin USERNAME="Daniel" FULLNAME="Daniel.Hector" PASSWORD="One@Two#8" PASSWORDHINT="One to Eight" sysadminctl -addUser "$USERNAME" -fullName "$FULLNAME" -password "$PASSWORD" -hint "$PASSWORDHINT" |
The administrator can provide the username and password of the new account against the USERNAME and PASSWORD fields respective. The display name and password hint of the new account can be specified against the FULLNAME and PASSWORDHINT fields.