Exports a number of Intune policies in csv and json format
You must be running PowerShell 7 for this script to work due to dependencies.
Running this script you agree to install Microsoft.Graph PowerShell modules and consent to permissions on your system so you can connect to GraphAPI to export Intune policy information
Connect using Graph API (Beta) and export Intune policies of choice. As of now these are the items that can be exported:
androidManagedAppProtections
configurationPolicies
deviceManagementScripts
deviceCompliancePolicies
deviceComplianceScripts
deviceConfigurations
deviceEnrollmentConfigurations
defaultManagedAppProtections
deviceManagementPartners
importedWindowsAutopilotDeviceIdentities
iosManagedAppProtections
iosUpdateStatuses
managedAppPolicies
managedAppRegistrations
mdmWindowsInformationProtectionPolicies
roleAssignments
roleDefinitions
resourceOperations
softwareUpdateStatusSummary
vppTokens
windowsAutopilotDeviceIdentities
-
EXAMPLE 1: PS C:\Export-IntunePolicy -ResourceType configurationPolicies
Retrieves Intune configurationPolicies and displays them in a limited custom formatted view
-
EXAMPLE 2: PS C:\Export-IntunePolicy -ResourceType configurationPolicies -ShowFull
Retrieves Intune configurationPolicies and displays them with all policy details to the console
-
EXAMPLE 3: PS C:\Export-IntunePolicy -ResourceType configurationPolicies -SaveResultsToCSV
Retrieves Intune configurationPolicies and saves the policies in csv format
-
EXAMPLE 4: PS C:\Export-IntunePolicy -ResourceType configurationPolicies -SaveResultsToJSON
Retrieves Intune configurationPolicies and saves the policies in json format
All policies will be exported in csv or json to "$env:Temp\ExportedIntunePolicies". This path can be changed if necessary.