Export & import your Intune tenant settings

If you’ve ever run into the need to change tenants (maybe your tenant trial has ended or you want to move settings from development to production), you may have noticed that there is no quick way to export settings from Intune. In this step-by-step post, we’ll go over using PowerShell to easily migrate settings.

1. Open a new tab and download the latest Intune PowerShell scripts from https://github.com/microsoftgraph/powershell-intune-samples. Save the .zip file into the downloads folder. Right-click on the powershell-intune-samples-master zip file and select Extract all > Extract.

2. Run PowerShell as an Administrator and accept the UAC popup. Run Set-ExecutionPolicy Bypass.

3. Run Install-Module AzureAD. Approve installing the module.

4. Run cd C:\Users\*YourUserAccount*\Downloads\powershell-intune-samples-master\powershell-intune-samples-master\DeviceConfiguration

If you’re looking to export other content from Intune, you would select another folder during this step and run that corresponding PowerShell script. Other options here include Company Portal Branding, Enrollment Restrictions, and Terms and Conditions.

5. Run .\DeviceConfiguration_Export.ps1

6. Sign-in using your Intune administrator account. Select the checkbox to consent on behalf of your organization and click Accept.

8. The next step is to provide the export location. Run C:\Users\*YourUserAccount*\Downloads\powershell-intune-samples-master\powershell-intune-samples-master\DeviceConfiguration

Now all of our settings are exported! We’ll follow the same general process for importing, except specifying the exported JSON file.

9. Run .\DeviceConfiguration_Import_FromJSON.ps1

10. Open the C:\Users\*YourUserAccount*\Downloads\powershell-intune-samples-master\powershell-intune-samples-master\DeviceConfiguration folder. While holding shift, copy as path the configuration profile. Paste into the PowerShell window.

11. Navigate back to the Azure Portal.

12. On the left navigation bar, click All Services > Intune. Click on Device Configuration and verify the profiles are duplicated. Since I reused my same tenant for this demo, I’ll see that the Autopilot Reset profile is duplicated:

You may also like...

9 Responses

  1. sam says:

    IIs there a way to import the MDMMigrationAnalysis.html into Intune once its created to save having to create each setting individually?

  2. loenders nick says:

    Is it also possible with this to set up one tenant perfectly with compliance policies, gpo’s and apps and such and then export it and import it into all my other tenants, so I don’t have to do all the settings everytime again?

  3. Kosipeich says:

    Is it possible to migrate intune configuration settings from one intune environment to another? As in can I grab your setting json files and import them in my intune? I noticed json files contain a number of guid-alike items

  4. Adam says:

    Any way to export Administrative Template-based settings? They don’t seem to get exported with the above script.

  5. NickOff says:

    Hi Janusz, it works perfectly except one of our huge Custom profile, getting below error. Have you seen this before, any tips?

    Response content:
    {“error”:{“code”:”BadRequest”,”message”:”Unable to read JSON request payload. Please ensure Content-Type header is set and payload is of valid JSON format.”,”innerError”:{“date”:”2021-07-04T10:59:11″,”request-id”:”5befa7df-f856-410e-babd-66ed047827b1″,”client-request-id”:”5befa7df-f856-410e-babd-66ed047827b1″}}}
    Add-DeviceConfigurationPolicy : Request to https://graph.microsoft.com/Beta/deviceManagement/deviceConfigurations
    failed with HTTP Status BadRequest Bad Request
    At C:\temp\powershell-intune-samples-master\DeviceConfiguration\DeviceConfiguration_Import_FromJSON.ps1:343 char:1
    + Add-DeviceConfigurationPolicy -JSON $JSON_Output
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-DeviceConfigurationPolicy

  1. January 20, 2021

    […] If this will be a net new Intune environment, one way to save time would be to import your old settings. This won’t import the assignments, but at least all of your configurations will be the same. We wrote a detailed guide on this process in a previous blog post: Export & import your Intune tenant settings – Device Advice […]

Leave a Reply

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