logo
search
Security Policy Errors

How to Fix Intune Custom Compliance Policy Error 65009

Muhammad TalhaMuhammad Talha Sep 27, 2026 869 views

Question details

The user needs to resolve error 65009 in Microsoft Intune, which occurs during custom compliance policy checks.

How to Fix Intune Custom Compliance Policy Error 65009
Product
Microsoft Intune
Device & OS
not provided
Scenario
Running a custom compliance discovery script via PowerShell that fails to validate correctly in Intune.
Observed behavior
The compliance script returns error 65009 indicating a JSON schema mismatch, even when the JSON output appears structurally valid in standard validators.
Before you start

Ensure you have administrator access to the Microsoft Intune admin center and can edit the PowerShell discovery script locally for testing.

Solution 1Recommended

Verify and Correct the PowerShell Script JSON Schema

Adjust your PowerShell script to ensure the returned JSON matches Microsoft Intune's strict schema requirements.

Intune error 65009 typically means the discovery script's JSON output does not perfectly align with the required compliance schema. Standard JSON validators only check for basic syntax, but Intune requires exact data types, setting names, and specific formatting.

1
Review the PowerShell Script

Open your custom compliance discovery script in PowerShell ISE, VS Code, or your preferred text editor.

2
Check Setting Names and Data Types

Verify that the setting names, data types, and Boolean compliance values exactly match the Intune custom compliance documentation. Ensure numbers are not wrapped in quotes if they should be integers.

3
Verify Formatting and Escaping

Check for correct capitalization and ensure complex strings like registry paths are properly escaped (e.g., using double backslashes where required).

4
Test JSON Output Locally

Execute the script locally on a test machine to generate the JSON output. Compare this output character-by-character with Intune's expected JSON structure to identify missing or incorrectly formatted fields.

Verify and Correct the PowerShell Script JSON Schema
Seek Specialist Help: If the schema is perfectly matched and the error continues, consider posting your script in the Microsoft Intune Community Hub or the Microsoft PowerShell Community for advanced assistance.
Free Microsoft Office alternative

Document Your IT Policies with WPS Office

While troubleshooting Intune compliance policies and scripts, use WPS Office as a free, lightweight, and highly compatible alternative to Microsoft Office to draft your IT documentation and standard operating procedures.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Create IT Documentation: Launch WPS Writer to draft detailed standard operating procedures (SOPs) for resolving Intune compliance errors.
  3. 3. Save and Share: Save your documentation in .docx format to easily share it with your IT team and administrators.
Seamless format compatibility with Microsoft Word, Excel, and PowerPoint (.docx, .xlsx, .pptx).Lightweight application that loads quickly without consuming heavy system resources.Ideal for IT administrators creating script documentation and compliance logs.Familiar user interface for a smooth transition with zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my JSON pass syntax validators but fail in Intune with Error 65009?

Standard JSON validators only confirm that the code is structurally sound. Intune requires a specific schema format, meaning your setting names, data types (like Booleans vs. strings), and values must exactly mirror its compliance policy expectations.

Can case sensitivity cause Intune custom compliance script errors?

Yes. Microsoft Intune is highly sensitive to capitalization. Incorrect casing in setting names, properties, or Boolean values within the returned JSON will trigger Error 65009.

Where can I get advanced help for Intune PowerShell scripts?

If adjusting the JSON schema does not resolve the issue, you can seek specialist help in the Microsoft Intune Community Hub or the Microsoft PowerShell Community forums.