A PowerShell tool that converts Microsoft Intune configuration policy JSON exports into Fleet-compatible Windows Configuration Service Provider (CSP) XML files.
This tool assists in migrating Microsoft Intune enrolled devices to Fleet by converting Intune policies into the SyncML XML format required by Fleet's Windows configuration profiles.
- Universal Conversion: Handles any Intune policy type with ~80% coverage out of the box
- Intelligent Format Detection: Automatically determines the correct SyncML format (bool, int, chr) based on Microsoft CSP documentation
- Registry-Based Path Resolution: Uses Windows CSP NodeCache registry to make sure proper TitleCase NodeURI paths
- Runtime Policy Resolution: Resolver map system for policies requiring dynamic value determination
- Comprehensive Logging: Detailed CSV logs showing conversion status for each policy
Convert-IntuneToFleetCSP.ps1- Main production-ready conversion scriptresolver-map.json- Configuration file containing PowerShell expressions for complex policy resolution
-
Export your Intune policy:
- Go to Microsoft Intune Admin Center
- Navigate to Devices > Configuration
- Select your policy and export as JSON
-
Run the converter:
.\Convert-IntuneToFleetCSP.ps1 -JsonPath "C:\Path\To\Your\Policy.json"
-
Review the output:
- Individual XML files created in
C:\CSPConverter\Output\ - Conversion log saved to
C:\CSPConverter\ConversionLog.csv
- Individual XML files created in
.\Convert-IntuneToFleetCSP.ps1 -JsonPath "MyFirewallPolicy.json".\Convert-IntuneToFleetCSP.ps1 -JsonPath "MyPolicy.json" -MergeXml -OutputPath "C:\Fleet\CSPs".\Convert-IntuneToFleetCSP.ps1 -JsonPath "MyPolicy.json" -DebugMode -DryRun.\Convert-IntuneToFleetCSP.ps1 -JsonPath "MyPolicy.json" -ResolverMapPath "C:\Custom\resolver-map.json"| Parameter | Description | Default |
|---|---|---|
JsonPath |
Path to Intune policy JSON export file | Required |
ResolverMapPath |
Path to resolver map JSON file | C:\CSPConverter\resolver-map.json |
OutputPath |
Directory for output XML files | C:\CSPConverter\Output |
LogPath |
Path for conversion log CSV file | C:\CSPConverter\ConversionLog.csv |
DebugMode |
Enable verbose debug output | $false |
DryRun |
Analyze only, don't create files | $false |
MergeXml |
Create single merged XML file | $false |
The script recursively parses the nested Intune JSON structure, extracting all individual policy settings, including parent choice values and child configurations.
For each policy, the script queries the Windows CSP NodeCache registry to:
- Find the exact NodeURI path with proper TitleCase formatting
- Retrieve the ExpectedValue (1=enabled, 0=disabled, -1=requires resolver)
Based on Microsoft CSP documentation and testing, the script determines whether each policy should use:
boolformat: For policies that explicitly require true/false valuesintformat: For most policies using 0/1 valueschrformat: For string values with CDATA wrapping
For policies with ExpectedValue = -1, the script uses the resolver map to execute PowerShell expressions that determine the current system value.
Each policy is converted to proper SyncML XML format:
<Replace>
<Item>
<Meta>
<Format xmlns="syncml:metinf">bool</Format>
</Meta>
<Target>
<LocURI>./Vendor/MSFT/Firewall/MdmStore/PrivateProfile/EnableFirewall</LocURI>
</Target>
<Data>true</Data>
</Item>
</Replace>The resolver-map.json file contains PowerShell expressions for policies that Intune sometimes leaves unset (ExpectedValue = -1). The script uses this file to query the Registry to verify the value. Each entry maps a CSP path segment to a PowerShell command:
{
"EnableFirewall": "if (@(Get-NetFirewallProfile | Where-Object { $_.Enabled -eq 'True' }).Count -gt 0) { 1 } else { 0 }",
"RealTimeProtection": "try { if ((Get-MpPreference -ErrorAction Stop).DisableRealtimeMonitoring -eq $false) { 1 } else { 0 } } catch { 1 }"
}To specify additional policies that should use boolean format, edit the $booleanFormatPolicies array in the Get-SyncMLFormatAndData function:
$booleanFormatPolicies = @(
"*firewall*enablefirewall*",
"*your*custom*policy*pattern*"
)Add entries to resolver-map.json for policies requiring dynamic value resolution:
{
"YourPolicyName": "PowerShell expression that returns 1 or 0"
}"No match found for NodeURI"
- The policy may not be supported on your Windows version
- Try running on a system where the policy has been applied via Intune
"Resolver execution failed"
- Check that the required PowerShell modules are available
- Verify the resolver expression syntax in
resolver-map.json
Enable debug mode to see detailed processing information:
.\Convert-IntuneToFleetCSP.ps1 -JsonPath "MyPolicy.json" -DebugMode- PowerShell 5.1 or later
- Windows system enrolled in Intune to retrieve settings from NodeCache
- Administrative rights for registry access (recommended)
The script is designed for ~80% coverage of standard Intune policies. For edge cases:
- Add patterns to the
$booleanFormatPoliciesarray - Create resolver map entries for complex policies
- Test with your specific policy types
For issues or questions:
- Check the conversion log CSV for detailed status information
- Use debug mode to troubleshoot specific policies
- Review Microsoft CSP documentation for policy-specific requirements