mirror of
https://github.com/jamf/Setup-Manager.git
synced 2026-02-03 14:13:24 +00:00
Pull Department and Building info from Jamf #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @staze on GitHub.
Realize there's no way to do without API, but would be nice to actually pull data from Jamf for things like Department and Building. Also ability to set arbitrary EAs.
@staze commented on GitHub:
Hey @scriptingosx . So yeah, I meant pull all departments or buildings from Jamf and let user pick, rather than populating a plist. But as you say, that falls into "API Credentials". It's unfortunate that Jamf doesn't provide some secure way to interact with the API without hardcoding credentials (obscured or not).
@scriptingosx commented on GitHub:
There is a way to get the Department and Building (and some other fields) for your scripts without the API.
You can create a custom profile in Jamf Pro with variables for department and building:
and push that down to the client. Jamf Pro will substitute the payload variables with the values in Jamf Pro.
You can then read the values from the profile in your policy scripts. There are a few approaches, I prefer using osascript/JXA:
There are quite a few caveats:
We are avoiding features that will require API access and thus providing API credentials to Setup Manager. There is already a request for arbitrary user entry fields #24
@scriptingosx commented on GitHub:
You could write a script using the API to generate the plist code for profile.