Policy and scripts for creating a utexas inventory.plist file
- Katelyn Russell
A script has been created (GLOBAL-inventory-plist) that can be used to store information on endpoints for use by other polices/scripts, such as the department code, Nessus group, and the IT support org department code. The plist is created in the following location. /Library/Application Support/utexas/inventory.plist
The Script:
#!/bin/sh ############################################################################################################ # # # This script is configured to use parameters within a Jamf policy to add values to utexas inventory plist # # # # Parameter 4 - Department Code # # Parameter 5 - Support Department Code # # Parameter 6 - Nessus Group # # # ############################################################################################################ ############################################################# # Check if utexas directory exists and creates it if needed # ############################################################# if [ ! -d /Library/Application\ Support/utexas/ ]; then mkdir -p /Library/Application\ Support/utexas/ fi ##################################################################################### # Check if DEPARTMENT CODE parameter was passed in parameter 4 and add to inventory # ##################################################################################### if [ "$4" != "" ] then defaults write /Library/Application\ Support/utexas/inventory.plist "Department Code" "$4" fi ############################################################################################# # Check if SUPPORT DEPARTMENT CODE parameter was passed in parameter 5 and add to inventory # ############################################################################################# if [ "$5" != "" ] then defaults write /Library/Application\ Support/utexas/inventory.plist "Support Department Code" "$5" fi ################################################################################## # Check if NESSUS GROUP parameter was passed in parameter 6 and add to inventory # ################################################################################## if [ "$6" != "" ] then defaults write /Library/Application\ Support/utexas/inventory.plist "Nessus Group" "$6" fi exit 0
Additional policies and scripts can write or read information to this location to store and obtain values.
Setting up the policy
- Log in to https://mdm.utexas.edu.
- Navigate to Computers > Policies
- Select New to create a new policy and give it a Display Name
- Navigate to the Scripts section and select Configure.
- Select Add next to the GLOBAL-inventory-plist script.
- Next, Enter the parameter values for Department Code, Support Department Code, and Nessus Group. (NOTE: do not include the ,macos as shown in the image - just the department code)
- Scope the policy to the appropriate systems and save the policy.
- When the policy is run on the target systems, the values entered will be stored in the plist for later retrieval and use in scripts and policies.
Retrieving values from the plist
To retrieve values for use in scripts, you can use the following commands:
defaults read /Library/Application\ Support/utexas/inventory.plist 'Department Code’
defaults read /Library/Application\ Support/utexas/inventory.plist 'Support Department Code'
defaults read /Library/Application\ Support/utexas/inventory.plist 'Nessus Group’
ADDITIONAL NOTES:
- Values can be saved as string variables if needed for easier use in scripts.
Adding additional values to the plist
If you would like to add your own key-value pairs to the plist, you can use a command in a script like the following example, where Data Classification is the key and Confidential is the value:
defaults write /Library/Application\ Support/utexas/inventory.plist ‘Data Classification’ ‘Confidential’
You can then retrieve the value of Data Classification with the following command:
defaults write /Library/Application\ Support/utexas/inventory.plist ‘Data Classification’
EPM is available to IT Support Organizations (ITSOs) with any endpoint management questions. If you have a question about a specific endpoint client, please reach out to your local endpoint client support organization.
- ConfigMgr: Every Tuesday, from 6 a.m. – 10 a.m.
- Jamf: Every Tuesday, from 8 a.m. – 12 p.m.
- Welcome to Jamf - Service Overview
- Application and Global Settings
- macOS Packet Firewall
- Deploying Microsoft Defender to macOS devices
- Global Configuration Policies
- Automatic install of Code42 in Campus JAMF
- Compliance Configuration and Extension Attribute
- Global Security & Compliance policies
- EPM Core team audit of Jamf Pro server
- MAC Address Randomization: How it works and What IT needs to know
- Upgrade to future macOS major releases
- Nessus Agent deployment to campus Jamf instances
- OS Patching: UT Macintosh Security Updates and Reboot Policy
- Jamf Connect
- Jamf - Site Administrator Policies
- Application installs and patching
- Installing UT-Track
- Centrally Managed iOS Password Standards
- Test and pilot
- Jamf - Server Maintenance and Update Process
Welcome to the University Wiki Service! Please use your IID (yourEID@eid.utexas.edu) when prompted for your email address during login or click here to enter your EID. If you are experiencing any issues loading content on pages, please try these steps to clear your browser cache. If you require further assistance, please email wikihelp@utexas.edu.