Table of Contents


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:

GLOBAL-Inventory-plist
#!/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

  1. Log in to https://mdm.utexas.edu
  2. Navigate to Computers > Policies
  3. Select New to create a new policy and give it a Display Name


  4. Navigate to the Scripts section and select Configure.


  5. Select Add next to the GLOBAL-inventory-plist script.


  6. 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)
  7. Scope the policy to the appropriate systems and save the policy.
  8. 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











Search UT EPM Documentation
Get Help

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.

SERVICE STATUS

Planned Maintenance

  • ConfigMgr: Every Tuesday, from 6 a.m. – 10 a.m.
  • Jamf: Every Tuesday, from 8 a.m. – 12 p.m.