Skip to main content
Question

Create Local Account based on Assigned User

  • August 26, 2020
  • 1 reply
  • 11 views

akw0045
Forum|alt.badge.img+10

Basically, I want to auto create a local user account based on who I assign the device to in Jamf (assigned user area pictured below). I would give a generic password initially and have the client log into Enterprise Connect or the SSO extension to sync the password with their company account.

Is there a way to do this? Or would I be better served just looking at NoMad Login or Jamf Connect Login?

1 reply

dan-snelson
Forum|alt.badge.img+30
  • Honored Contributor
  • August 27, 2020

@akw0045 You should be able to use the Classic API to look up the assigned username from the Jamf Pro computer record with something like …
../../JSSResource/computers/match/${computerSerialNumber}

… the following snippets may help:

computerSerialNumber=$( /usr/sbin/system_profiler SPHardwareDataType | grep Serial | /usr/bin/awk '{print $NF}' )
jamfProCompID=$( /usr/bin/curl -s -u ${apiUsername}:${apiPassword} ${jamfProURL}/JSSResource/computers/serialnumber/${computerSerialNumber}/subset/general | /usr/bin/xpath "//computer/general/id/text()" )

Then you can use sysadminctl or the JAMF binary to create the account:
/usr/local/bin/jamf createAccount -username ${username} -realname ${realname} -password "${password}" -home "/Users/${username}" -admin -suppressSetupAssistant