You may have a requirement to export or import Microsoft Intune policies while working on Intune tenant to tenant migration as part of divestiture, merger or acquisition. It’s also required when you tested the policy in a test environment and later need to migrate the same to production environment. You can also have standard set of policies in JSON to quickly import them while working on a new tenant setup. The imported policy can be further customized as per organization requirements.
As of now there are no options available in Intune admin center to duplicate or export Intune device configuration profile. This make the things difficult when you need to export Intune policies to different tenants or want to duplicate a profile to quickly create another one.
The options to duplicate or export settings are available for Settings catalog. However for other profile types, we can use the PowerShell samples scripts available in GitHub. In this blog post, we will discuss how to export and import Device Configuration Profiles using PowerShell Sample Scripts. You can export / import configuration profiles (Device features, Device restrictions, Kiosk etc.) using this script.
Export Device Configuration Profiles in JSON File
Follow the below steps to export Device configuration profiles in JSON file.
- Download the Intune PowerShell scripts from PowerShell Intune Samples and extract all files to local drive.
- Run PowerShell as an Administrator.
- Set PowerShell execution Policy to ByPass ( Set-ExecutionPolicy bypass )
- Install PowerShell AzureAD and Microsoft Graph Module if not already installed.
- Change the location to the “DeviceConfiguration” under “Powershell-intune-samples-master”
- Run the script .\DeviceConfiguration_Export.ps1
- If prompted, login with your Azure AD / Entra ID credential.
- Specify a path to export the policy data.
The PowerShell script exports each device configuration policies in separate JSON file in the path you provided.
You can open the File Explorer and browse to the folder to see each JSON file.
How to Import Device Configuration Policy from JSON File
We can now import the device configuration policy from JSON file to a new tenant or same tenant to create another policy. If you need to import the policy in same tenant then simply open the JSON file in notepad and update the policy name. Else policy will be created with same name which may leads to confusion.
Please note that imported policies remain unassigned. You need to assign them to device , users or groups to move them to production.
Follow the below steps to import the policies to Intune tenant.
- Follow the initial steps you have used to export the policies to JSON file.
- Change the directory to “DeviceConfiguration” folder and run the script .\DeviceConfiguration_import_FromJSON.ps1 -FileName <FileName>
You can see the import progress on screen. The script will return to prompt once import process completed.
You can now see the imported policy in Microsoft Intune admin center. Since we have used same tenant for testing, you can see that two policies exists with same name.
Related Posts
- How To Export Serial number of Multiple Devices using PowerShell SDK for Intune Graph API
- How to Export Managed Device Details from Intune
- Export Device Configuration Profiles List in Intune
- How to Export Settings Catalog Policy in Intune
- Export and Import Device Compliance Policies in Intune
- How to Export Device Configuration Profiles in Intune
- How to Export Endpoint Security Policies in Intune
- How to Provision Windows 10 / Windows 11 Device using Intune and Windows Autopilot
Subscribe to Techuisitive Newsletter
Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.