Skip to main content
Solved

How to deploy plist with array


Forum|alt.badge.img+3
  • New Contributor
  • 6 replies

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

Best answer by talkingmoose

Yvan wrote:

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 original
Did this topic help you find an answer to your question?

10 replies

talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1901 replies
  • February 6, 2024

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?


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • February 6, 2024
talkingmoose wrote:

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?


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
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • February 6, 2024
Yvan wrote:

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.


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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • February 6, 2024

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


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1901 replies
  • February 6, 2024
Yvan wrote:

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.


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.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • February 6, 2024
Yvan wrote:

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


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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • February 7, 2024
talkingmoose wrote:

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.


Sure- here the link : https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/switch-organizations/


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • February 7, 2024

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.


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1901 replies
  • Answer
  • February 7, 2024
Yvan wrote:

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>

 


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1901 replies
  • February 7, 2024
talkingmoose wrote:

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>

 


Reply


Cookie 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