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. Hello! obi-lab.at

    We suggest

    Sending your commercial proposal through the Contact us form which can be found on the sites in the Communication partition. Contact form 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 improve the chances that your message will be read.

    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
    WhatsApp – +44 7598 509161
    Email – FeedbackForm@make-success.com

Leave a Reply to ContactForm Cancel reply

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