Skip to main content
Question

assign users to computers via API

  • September 29, 2015
  • 6 replies
  • 0 views

Forum|alt.badge.img+15

Has anyone been able to assign users to a computer via API I am having trouble navigating the API docs. I want to use cocoadialog to prompt our techs to enter a userID and then assign the mac to that user.

6 replies

Forum|alt.badge.img+12
  • Valued Contributor
  • 157 replies
  • September 29, 2015

What I do is have a policy that's scoped to all computers, but limited to our technicians' LDAP group. When the user is logged into the computer, the technician logs into self service and runs a policy with this script:

#!/bin/sh

# get the last user that logged into the computer
lastUser=`defaults read /Library/Preferences/com.apple.loginwindow lastUserName`

# echo the last user's username so it's in the policy log for error checking
echo "$lastUser is last user"

# submit inventory for the last user's username in the JSS
jamf recon -endUsername "$lastUser"

Forum|alt.badge.img+15
  • Author
  • Contributor
  • 92 replies
  • September 29, 2015

Thanks @jbourdon but since our JSS talks to our service desk system I need this to happen during initial setup


Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • September 29, 2015

@RogerUL Can you be more specific on what it is you want with this? Where are you looking to assign the user to the computer? In the User and Location details?


Forum|alt.badge.img+15
  • Author
  • Contributor
  • 92 replies
  • September 29, 2015

@mm2270 yes exactly


Forum|alt.badge.img+12
  • Contributor
  • 153 replies
  • September 29, 2015

Have you tried using the check box of "Collect user and location information from LDAP" from here? https://jss.vcpusd.k12.ca.us:8443/inventoryCollection.html?id=0&o=r


Forum|alt.badge.img+1
  • New Contributor
  • 4 replies
  • January 24, 2017

Was any progress ever made with this? automating the process with the API?


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