JAMF API - Prestage Enrollment

rkeleghan
New Contributor III

Hi All,

Just wondering .. Using the JAMF API - Can I check that prestage a macOS in enrolled in or part of?

 

Rk

3 REPLIES 3

danitree
New Contributor III

Hi @rkeleghan,

If you're using the Classic API you can't retrieve any info of your PreStage like computers went through, profiles used, or skip setup items.

You could only check if a specific computer has gone through DEP and you would assume that a PreStage has been created thanks to the "management_status" property:

Screenshot 2021-10-29 at 15.16.24.png

 

With the Jamf Pro API you could check the option "/v2/computer-prestages/{id}" to see all the devices with that exact profile and therefore make other searches:

Screenshot 2021-10-29 at 15.24.38.pngScreenshot 2021-10-29 at 15.24.57.png

 

Hope it helps.

Using talking moose 's code (thanks a lot!) I did a litte script to move machines from one PrestageEnrollment to another https://gist.github.com/MichaelandMore/d19ccf71f5486ce0db442eedf85953dc

Malcolm
Contributor II

I'm looking at this at present also, as we had been setting prefix information via the vendor field of prestages, however this isn't reflected correctly to a device if its prestage is moved, the old presage will remain listed under general, and obviously the vendor info where we would store the prefix for the naming convention wouldn't change even if the prestage under general would change automatically on moving the device from one prestage to another.

 

presently moving forward it's looking like I would need to populate my own records via extension attributes generated from api lookup against: /v2/computer-prestages/scope
which seemingly would result in a big dump of all serials and the associated prestage ids to query against, to then query the assigned prestage for the vendor info and prestage name to then populate new attribute fields via extension attribute scripts.

I've just opened a support ticket, about how the prestage listing under the device, is reflective of the original prestage it was enrolled to, and not its current one. and that the computer commands, do not provide, suitable prestage information, such as a the correct associated prestage ID the device is a member of. Hopefully some of this will be fixed in future releases.