![]() ![]() One other thing - because this has the jamf binary accessing System Events, you might run into a PPPC issue when the script is run on any macOS Mojave systems where they will see a prompt to allow the jamf binary to access System Events. UDID=$(ioreg -rd1 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformUUID/.xmlĮcho "User canceled from selection. JSS_URL=$(/usr/bin/defaults read /Library/Preferences/ jss_url | sed 's|/$||') ![]() # The Jamf Pro server URL this Mac is enrolled to Please check the policy script parameters and try again." ![]() If || || thenĮcho "One of the required script parameters was not filled in. ![]() # Make sure we got values for the 3 parameters above computerExtensionAttributes.html?id= 8&o=r where 8 is the ID) Make sure the account you add has the ability to read and update computer records. When using the script in the policy, be sure to add in a value in Parameters 4, 5 and 6, for the API account name, password and the EA's ID (you can view the ID by viewing the Extension Attribute itself - the ID will be in the URL in your browser, like. The EA ID part isn't as necessary (it could be hardcoded), but I put it there to make it a little more flexible, i.e, if you have other EAs that use drop down values, the same script could be used to provide an interactive way to apply them to a machine. In general, when needing to use things like API account credentials, especially if that account has access to write back to your Jamf server, it's best to put them into parameters so it's more secure. If you haven't used script parameters before, these are essentially placeholders in the script that, at script run time, the Jamf Pro server will pass down a value for them that you specify in the policy where you add the script. To use this, you need to use script parameters to pass the API account username, password and the Extension Attribute's id to it. I already tested this myself so I know it works as long as it's set up correctly. Here is a script that should do what you're looking for. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |