Setting your Munki ClientID as part of a Deploy Studio workflow.

1) Use the hostname form. Important fields are “Computer Name” and “Computer Information #4”
2) Ensure that you have the “Configure” step set up in the workflow and are applying those fields
3) Install Munki Tools and your generic ManagedInstalls.pref
4) Include this script – execute after restart. The script will first check the “Computer Information #4” field, and if empty will reference the “Computer Name” and set ClientIdentifier in the ManagedInstalls.plist file to that value. If neither is filled in, then it silent exits and touches nothing.

Script is below:

#! /bin/bash

### This script checks for a value in the fourth custom field set by ARD/DeployStudio
### and then the computer name (in the Sharing prefpane).
### If a value exists in the custom field, it sets the Client Identifier in 
### ManagedInstalls.plist to that value, other wise it sets the ClientIdentifier to
### the Computer Name.
### -- Tim Schutt, December 13, 2012

SYSCLIENTID=$(scutil --get ComputerName)
CUSTCLIENTID=$(defaults read /Library/Preferences/ Text4)

if [ -n "$CUSTCLIENTID" ]
	defaults write /Library/Preferences/ManagedInstalls ClientIdentifier $CUSTCLIENTID
elif [ -n "$SYSCLIENTID" ]
	defaults write /Library/Preferences/ManagedInstalls ClientIdentifier $SYSCLIENTID

exit 0

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove yourself. *