How to deploy plist with array

Yvan
New Contributor II

Hi, 

 

I am trying to deploy a new plist from JAMF but this one contains <array> and it failed to deploy.
here the example :

<?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.0">
<array>
  <dict>
    <key>organization</key>
    <string>company1</string>
    <key>display_name</key>
    <string>C1</string>
    <key>onboarding</key>
    <false/>
  </dict>
  <dict>
    <key>organization</key>
    <string>company2</string>
    <key>display_name</key>
    <string>C2</string>
    <key>onboarding</key>
    <false/>
  </dict>
</array>
</plist>
 
if I remove array ti works well (it was default plist). Any idea why JAMF refuse to deploy plist who contains array`?
Thanks
2 ACCEPTED SOLUTIONS

If you haven’t yet, it would be worth downloading their example mobileconfig file and examining that.

Something I think I see missing from your plist are the <dict> and </dict> tags that generally come at the beginning and end of the plist just inside the <plist> and </plist> tags. I think all plists are a dictionary first.

 

<?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.0">
<dict>
	<array>
	  <dict>
		<key>organization</key>
		<string>company1</string>
		<key>display_name</key>
		<string>C1</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	  <dict>
		<key>organization</key>
		<string>company2</string>
		<key>display_name</key>
		<string>C2</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	</array>
</dict>
</plist>

 

View solution in original post

I downloaded the mobileconfig file, and I believe you're also missing a key. Try this:

 

<?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.0">
<dict>
	<key>configs</key>
	<array>
	  <dict>
		<key>organization</key>
		<string>company1</string>
		<key>display_name</key>
		<string>C1</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	  <dict>
		<key>organization</key>
		<string>company2</string>
		<key>display_name</key>
		<string>C2</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	</array>
</dict>
</plist>

 

View solution in original post

10 REPLIES 10

talkingmoose
Moderator
Moderator

Some additional information would be helpful.

What are you trying to accomplish with this plist? What are you expecting to see? And what are you actually seeing?

Yvan
New Contributor II

This plist file is used to set up an application.
Following documentation from the app - I should be able to add 2 organization (see plist).
If I deploy only 1 organization (so no need of array) - this works well.

mm2270
Legendary Contributor III

There's nothing wrong with the plist as far as I can tell. You can check plist files for issues using a few different tools, including xmllint, which ships with the macOS.

My question is, you mention you're trying to deploy it, but how exactly? Is the plist file created locally and then packaged up? Is it being scripted out? If it's being scripted, how exactly are you attempting to create this plist in your script.

You haven't given us enough information to really be able to help you.

Can you link to the vendor's documentation for us to review too? And does the documentation explicitly state you can create an array like this? Their software has to support it.

If you haven’t yet, it would be worth downloading their example mobileconfig file and examining that.

Something I think I see missing from your plist are the <dict> and </dict> tags that generally come at the beginning and end of the plist just inside the <plist> and </plist> tags. I think all plists are a dictionary first.

 

<?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.0">
<dict>
	<array>
	  <dict>
		<key>organization</key>
		<string>company1</string>
		<key>display_name</key>
		<string>C1</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	  <dict>
		<key>organization</key>
		<string>company2</string>
		<key>display_name</key>
		<string>C2</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	</array>
</dict>
</plist>

 

I downloaded the mobileconfig file, and I believe you're also missing a key. Try this:

 

<?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.0">
<dict>
	<key>configs</key>
	<array>
	  <dict>
		<key>organization</key>
		<string>company1</string>
		<key>display_name</key>
		<string>C1</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	  <dict>
		<key>organization</key>
		<string>company2</string>
		<key>display_name</key>
		<string>C2</string>
		<key>onboarding</key>
		<false/>
	  </dict>
	</array>
</dict>
</plist>

 

Yvan
New Contributor II

Hi, 

This plist is deployed from Configuration profile , under Application & Custom settings.
I deployed 1 already but with only 1 organization and without <array> inside and it works very well. I can see it under profile on my mac.
If I add 2 organization - so adding <array> - in Logs I can see "Failed".


Thanks

mm2270
Legendary Contributor III

Ok, understood now. As I mentioned, the plist format seems fine to me, so if it's failing to deploy to your Macs, the only thing that comes to mind is that it's probably an issue on the software side. Although, not sure that that really makes sense to me either. Jamf should be able to deploy the plist to a Mac as long as the plist is not malformed. I don't think it would care what software it's meant for. But I don't know.

Yvan
New Contributor II

the software can be installed without profile - this profile will only give some info like our organization name and other settings.
I agreed with you about Jamf should be able to deploy it as the plist seems fine.