I'm trying to automate more of my imaging workflow/AD maintenance and this would be really helpful if it's possible.
I know it should be possible to pull a value for a machine's extension attribute using the API, but I don't really know how to achieve it. The EA is called "Client Room" and I'd like to pull that value then write it to the device's description field in AD if that's possible. Does anyone have any pointers here? I've no idea how to even start writing to AD, if it can be done.
Ideally, it'd also be nice to pull both the "Client Room" value another extension attribute, "Client Group", and write those as Apple Remote Desktop info fields 1 and 2. Same deal here, I haven't really worked with the API enough to know where to start, so any help would be very much appreciated.
Have a look at https://YourJSSServer.edu/api Getting data from the JSS via the API is pretty easy. You can pull XML or JSON.
#!/bin/sh server="https://my.school.edu:8443" curl -H "Accept: application/xml" -sfku "$username:$password" "$server/JSSResource/computerextensionattributes/name/myFavoriteExtension" -X GET | xmllint --format - > /tmp/myFavEA.xml