I am trying to automate the creation of an Outlook signature and I have most of the parts down except I can't find a way to pass values from User and Location to the script. I thought passing $FULLNAME or $POSITION as script parameters would work but all it does is literally pass the string "$FULLNAME" to the script.
- Home
- Community
- Get Support
- General Discussions
- How to pass User and Location values to script
How to pass User and Location values to script
- June 8, 2024
- 12 replies
- 92 views

- Contributor
- 28 replies
Best answer by shannon_pasto
Hi Moose,
I tried removing the spaces and then rebooting after removing the CP and re-applying it just to make sure but it made no difference.
Don't know how to attach images in a post so inserting a link to it instead ...
https://drive.google.com/file/d/1RJSGKBjtHpT4_i7RV0HNl-146vssMNDs/view?usp=sharing
It seems as though your plist file is improperly formatted. Try reading another plist in the same directory (/Library/Managed Preferences) and you'll see what the difference is. None of the profile info should be there, ie PayloadContent etc
12 replies

- Contributor
- 96 replies
- June 8, 2024
You’ll probably need to do an API call to get that information. If you’re using Jamf Connect you could get some of the information from the com.jamf.connect.state.plist file for the user

- Author
- Contributor
- 28 replies
- June 8, 2024
I found this post on Der Flounder which suggested creating a config profile to store computer inventory information in a .plist file which could then be queried using a "defaults read" command. However, when I run the command, it tells me that the domain/pair cannot be found (I have created the sample config profile and I can see the /Library/Managed Preferences/com.company.information.plist file).

- Contributor
- 96 replies
- June 8, 2024
I found this post on Der Flounder which suggested creating a config profile to store computer inventory information in a .plist file which could then be queried using a "defaults read" command. However, when I run the command, it tells me that the domain/pair cannot be found (I have created the sample config profile and I can see the /Library/Managed Preferences/com.company.information.plist file).
For that data to be in the profile it will need to be on the Jamf record at the time it installs on the Mac.

- Author
- Contributor
- 28 replies
- June 8, 2024
For that data to be in the profile it will need to be on the Jamf record at the time it installs on the Mac.
Hi Shannon,
Yes, when I run "defaults read /Library/Managed Preferences/com.company.information.plist" I get a whole lot of data. But when I run "defaults read /Library/Managed Preferences/com.company.information.plist Company User's Name" I get the error "domain/default pair does not exist"

- Contributor
- 96 replies
- June 8, 2024
Hi Shannon,
Yes, when I run "defaults read /Library/Managed Preferences/com.company.information.plist" I get a whole lot of data. But when I run "defaults read /Library/Managed Preferences/com.company.information.plist Company User's Name" I get the error "domain/default pair does not exist"
So you’ll need to install the profile after the data you require is populated on the jamf record or find another way to get the data

- Author
- Contributor
- 28 replies
- June 8, 2024
So you’ll need to install the profile after the data you require is populated on the jamf record or find another way to get the data
Maybe I am misunderstanding you but the data as far as I can tell is already populated ....
I can see them when I do a "defaults read /Library/Managed Preferences/com.company.information.plist" ... the output shows that the field "Computer User's Name" already contains the user's Full Name as recorded under User and Location.
And yet when I run "defaults read /Library/Managed Preferences/com.company.information.plist Computer User's Name" I get an error

- Contributor
- 96 replies
- June 8, 2024
If all of the required data is there when you "defaults read /Library/Managed Preferences/com.company.information.plist" but not when you use the key then you have a syntax problem with the defaults command. Maybe it's the apostrophe?
- Community Manager
- 1911 replies
- June 8, 2024
Maybe I am misunderstanding you but the data as far as I can tell is already populated ....
I can see them when I do a "defaults read /Library/Managed Preferences/com.company.information.plist" ... the output shows that the field "Computer User's Name" already contains the user's Full Name as recorded under User and Location.
And yet when I run "defaults read /Library/Managed Preferences/com.company.information.plist Computer User's Name" I get an error
I believe the problem you’re seeing is with spaces. Plist keys should be written as a single word. Also, you need to put quotes around paths when those paths contain spaces.
Rename the key to a single word. Something like “ComputerUserName”.
The run:
defaults read "/Library/Managed Preferences/com.company.information.plist" ComputerUserName

- Author
- Contributor
- 28 replies
- June 8, 2024
I believe the problem you’re seeing is with spaces. Plist keys should be written as a single word. Also, you need to put quotes around paths when those paths contain spaces.
Rename the key to a single word. Something like “ComputerUserName”.
The run:
defaults read "/Library/Managed Preferences/com.company.information.plist" ComputerUserName
Hi Moose,
I tried removing the spaces and then rebooting after removing the CP and re-applying it just to make sure but it made no difference.
Don't know how to attach images in a post so inserting a link to it instead ...
https://drive.google.com/file/d/1RJSGKBjtHpT4_i7RV0HNl-146vssMNDs/view?usp=sharing

- Contributor
- 96 replies
- Answer
- June 8, 2024
Hi Moose,
I tried removing the spaces and then rebooting after removing the CP and re-applying it just to make sure but it made no difference.
Don't know how to attach images in a post so inserting a link to it instead ...
https://drive.google.com/file/d/1RJSGKBjtHpT4_i7RV0HNl-146vssMNDs/view?usp=sharing
It seems as though your plist file is improperly formatted. Try reading another plist in the same directory (/Library/Managed Preferences) and you'll see what the difference is. None of the profile info should be there, ie PayloadContent etc

- Author
- Contributor
- 28 replies
- June 9, 2024
It seems as though your plist file is improperly formatted. Try reading another plist in the same directory (/Library/Managed Preferences) and you'll see what the difference is. None of the profile info should be there, ie PayloadContent etc
Yes, I was wondering about that as I didn't see those values in other PLISTs that I've uploaded before. Also, iMazing Profile Editor reported an "unfamiliar domain" error. I'm not deeply knowledgeable with PLISTs as I've only edited existing values before but never added different sections/areas. I'll give it a go and see what happens. Thanks.

- Author
- Contributor
- 28 replies
- June 9, 2024
Yes, I was wondering about that as I didn't see those values in other PLISTs that I've uploaded before. Also, iMazing Profile Editor reported an "unfamiliar domain" error. I'm not deeply knowledgeable with PLISTs as I've only edited existing values before but never added different sections/areas. I'll give it a go and see what happens. Thanks.
OK, so I've deleted everything except just he key/value pairings and changed the keys to not have spaces. It's working now ...
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1"> <dict> <key>Computer_Jamf_Pro_ID_Number</key> <string>$JSSID</string> <key>Computer_Name</key> <string>$COMPUTERNAME</string> <key>Computer_MAC_Address</key> <string>$MACADDRESS</string> <key>Computer_Serial_Number</key> <string>$SERIALNUMBER</string> <key>Computer_UDID</key> <string>$UDID</string> <key>Computer_User_Email_Address</key> <string>$EMAIL</string> <key>Computer_User_Full_Name</key> <string>$REALNAME</string> <key>Computer_User_Office_Building_ID</key> <string>$BUILDINGID</string> <key>Computer_User_Office_Building_Name</key> <string>$BUILDINGNAME</string> <key>Computer_User_Department_Name</key> <string>$DEPARTMENTNAME</string> <key>Computer_User_Department ID</key> <string>$DEPARTMENTID</string> <key>Computer_User_Position</key> <string>$POSITION</string> <key>Computer_User_Room_Location</key> <string>$ROOM</string> <key>Computer_User_Phone_Number</key> <string>$PHONE</string> <key>Computer_User_Username</key> <string>$USERNAME</string> <key>Site</key> <string>$SITENAME</string> <key>Site_ID</key> <string>$SITEID</string> </dict> </plist>
Thanks Shannon! I was about ready to just awk and sed it 😀
I am trying to automate the creation of an Outlook signature and I have most of the parts down except I can't find a way to pass values from User and Location to the script. I thought passing $FULLNAME or $POSITION as script parameters would work but all it does is literally pass the string "$FULLNAME" to the script.
You’ll probably need to do an API call to get that information. If you’re using Jamf Connect you could get some of the information from the com.jamf.connect.state.plist file for the user
I found this post on Der Flounder which suggested creating a config profile to store computer inventory information in a .plist file which could then be queried using a "defaults read" command. However, when I run the command, it tells me that the domain/pair cannot be found (I have created the sample config profile and I can see the /Library/Managed Preferences/com.company.information.plist file).
I found this post on Der Flounder which suggested creating a config profile to store computer inventory information in a .plist file which could then be queried using a "defaults read" command. However, when I run the command, it tells me that the domain/pair cannot be found (I have created the sample config profile and I can see the /Library/Managed Preferences/com.company.information.plist file).
For that data to be in the profile it will need to be on the Jamf record at the time it installs on the Mac.
For that data to be in the profile it will need to be on the Jamf record at the time it installs on the Mac.
Hi Shannon,
Yes, when I run "defaults read /Library/Managed Preferences/com.company.information.plist" I get a whole lot of data. But when I run "defaults read /Library/Managed Preferences/com.company.information.plist Company User's Name" I get the error "domain/default pair does not exist"
Hi Shannon,
Yes, when I run "defaults read /Library/Managed Preferences/com.company.information.plist" I get a whole lot of data. But when I run "defaults read /Library/Managed Preferences/com.company.information.plist Company User's Name" I get the error "domain/default pair does not exist"
So you’ll need to install the profile after the data you require is populated on the jamf record or find another way to get the data
So you’ll need to install the profile after the data you require is populated on the jamf record or find another way to get the data
Maybe I am misunderstanding you but the data as far as I can tell is already populated ....
I can see them when I do a "defaults read /Library/Managed Preferences/com.company.information.plist" ... the output shows that the field "Computer User's Name" already contains the user's Full Name as recorded under User and Location.
And yet when I run "defaults read /Library/Managed Preferences/com.company.information.plist Computer User's Name" I get an error
If all of the required data is there when you "defaults read /Library/Managed Preferences/com.company.information.plist" but not when you use the key then you have a syntax problem with the defaults command. Maybe it's the apostrophe?
Maybe I am misunderstanding you but the data as far as I can tell is already populated ....
I can see them when I do a "defaults read /Library/Managed Preferences/com.company.information.plist" ... the output shows that the field "Computer User's Name" already contains the user's Full Name as recorded under User and Location.
And yet when I run "defaults read /Library/Managed Preferences/com.company.information.plist Computer User's Name" I get an error
I believe the problem you’re seeing is with spaces. Plist keys should be written as a single word. Also, you need to put quotes around paths when those paths contain spaces.
Rename the key to a single word. Something like “ComputerUserName”.
The run:
defaults read "/Library/Managed Preferences/com.company.information.plist" ComputerUserName
I believe the problem you’re seeing is with spaces. Plist keys should be written as a single word. Also, you need to put quotes around paths when those paths contain spaces.
Rename the key to a single word. Something like “ComputerUserName”.
The run:
defaults read "/Library/Managed Preferences/com.company.information.plist" ComputerUserName
Hi Moose,
I tried removing the spaces and then rebooting after removing the CP and re-applying it just to make sure but it made no difference.
Don't know how to attach images in a post so inserting a link to it instead ...
https://drive.google.com/file/d/1RJSGKBjtHpT4_i7RV0HNl-146vssMNDs/view?usp=sharing
Hi Moose,
I tried removing the spaces and then rebooting after removing the CP and re-applying it just to make sure but it made no difference.
Don't know how to attach images in a post so inserting a link to it instead ...
https://drive.google.com/file/d/1RJSGKBjtHpT4_i7RV0HNl-146vssMNDs/view?usp=sharing
It seems as though your plist file is improperly formatted. Try reading another plist in the same directory (/Library/Managed Preferences) and you'll see what the difference is. None of the profile info should be there, ie PayloadContent etc
It seems as though your plist file is improperly formatted. Try reading another plist in the same directory (/Library/Managed Preferences) and you'll see what the difference is. None of the profile info should be there, ie PayloadContent etc
Yes, I was wondering about that as I didn't see those values in other PLISTs that I've uploaded before. Also, iMazing Profile Editor reported an "unfamiliar domain" error. I'm not deeply knowledgeable with PLISTs as I've only edited existing values before but never added different sections/areas. I'll give it a go and see what happens. Thanks.
Yes, I was wondering about that as I didn't see those values in other PLISTs that I've uploaded before. Also, iMazing Profile Editor reported an "unfamiliar domain" error. I'm not deeply knowledgeable with PLISTs as I've only edited existing values before but never added different sections/areas. I'll give it a go and see what happens. Thanks.
OK, so I've deleted everything except just he key/value pairings and changed the keys to not have spaces. It's working now ...
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1"> <dict> <key>Computer_Jamf_Pro_ID_Number</key> <string>$JSSID</string> <key>Computer_Name</key> <string>$COMPUTERNAME</string> <key>Computer_MAC_Address</key> <string>$MACADDRESS</string> <key>Computer_Serial_Number</key> <string>$SERIALNUMBER</string> <key>Computer_UDID</key> <string>$UDID</string> <key>Computer_User_Email_Address</key> <string>$EMAIL</string> <key>Computer_User_Full_Name</key> <string>$REALNAME</string> <key>Computer_User_Office_Building_ID</key> <string>$BUILDINGID</string> <key>Computer_User_Office_Building_Name</key> <string>$BUILDINGNAME</string> <key>Computer_User_Department_Name</key> <string>$DEPARTMENTNAME</string> <key>Computer_User_Department ID</key> <string>$DEPARTMENTID</string> <key>Computer_User_Position</key> <string>$POSITION</string> <key>Computer_User_Room_Location</key> <string>$ROOM</string> <key>Computer_User_Phone_Number</key> <string>$PHONE</string> <key>Computer_User_Username</key> <string>$USERNAME</string> <key>Site</key> <string>$SITENAME</string> <key>Site_ID</key> <string>$SITEID</string> </dict> </plist>
Thanks Shannon! I was about ready to just awk and sed it 😀
Reply
Related topics
Launchdaemon run script issuesicon
General DiscussionsLaunchDaemon runs script, calls jamf policy with jamfhelper issueicon
General Discussionstime issuesicon
General DiscussionsI'm taking on Jamf Pro management for my work.icon
General DiscussionsMultiple policies don't run on same custom trigger anymoreicon
General Discussions
Most helpful members this week
- thebrucecarter
13 likes
- Chubs
11 likes
- tommypatzius
10 likes
- Alyoung
8 likes
- woaikonglong
8 likes
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Scanning file for viruses.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
OKThis file cannot be downloaded
Sorry, our virus scanner detected that this file isn't safe to download.
OKCookie policy
We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.
Cookie settings
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.