Upload custom iOS Intune Configuration via Graph API

A customer is right now migrating from a Thirdparty MDM solution to Microsoft Intune. He has a custom iOS IMAP configuration for round about 30 users and do not wanted them to migrate every policy manually so we created a quick Powershell script which is changing the user values inside the XML and uploads them as a configuration via the Intune Graph API.
The interesting part was, that these are Exchange Online Shared mailboxes which have to be configured with the primary user’s UPN account.

So I have taken the DeviceConfiguration_Add.ps1 Powershell Script from the Intune Github Sample Page and added/changed the following things.
The full script is available as a GIST or on the bottom of the blog post.

  • Added a parameter named $upn which is getting the User Principal Name for which user the policy should be built. Line 14-17

     

  • Added a region called “Build XML” where I am replacing some Usernames with variables. Line 320 – 408

     

  • Finally a region called “Build JSON Payload” where I encoding the UTF8 XML Payload to a BASE64 string and building the JSON request. Line 410 – 425

     


    This is my first public Powershell script, so if there are any requests to make it portable and do some error checks I am happy about your feedback.

 

And here is the full script.

2 thoughts on “Upload custom iOS Intune Configuration via Graph API”

  1. Hi! obi-lab.at

    We offer

    Sending your message through the feedback form which can be found on the sites in the contact partition. Feedback forms are filled in by our software and the captcha is solved. The advantage of this method is that messages sent through feedback forms are whitelisted. This method increases the probability that your message will be open.

    Our database contains more than 25 million sites around the world to which we can send your message.

    The cost of one million messages 49 USD

    FREE TEST mailing of 50,000 messages to any country of your choice.

    This message is automatically generated to use our contacts for communication.

    Contact us.
    Telegram – @FeedbackFormEU
    Skype FeedbackForm2019
    Email – FeedbackForm@make-success.com
    WhatsApp – +44 7598 509161

Leave a Reply

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

*