I am still struggling so hard with API and bash syntax, due to lack of training. 😕
As I have a time-sensitive and crucial task to fulfill that does not leave so much time left for trial and error, could someone hint me how to get a site name (and define it as variable $site) via the Mac's UDID through API?
What would the curl call (and the formatting) need to look like?
Thanks a million! 🙂
Try it this way. If there is a Site assigned to the Mac or not, it should return something. Even if one is not assigned it returns a string of "None"
curl -sku "apiUser:password" https://your.jamfcloud.com/JSSResource/computers/udid/<UDID here>/subset/general -X GET -H "Accept: application/xml" | xpath '/computer/general/site/name/text()'