The JSON validation file defines the compliance rules that Intune applies to your script's output. Each setting must match the keys returned by your PowerShell script exactly.
Create a file named SecurityAgentCompliance.json with the following structure:
{
"Settings": [
{
"Name": "SecurityAgentVersion",
"Type": "String",
"Operator": "IsEquals",
"CompliantValue": "3.2.1",
"RemediationStrings": {
"Language": "en_US",
"Title": "Security Agent Update Required",
"Message": "Your security agent version is outdated. Please update to version 3.2.1 or later from the company portal or contact IT support."
}
},
{
"Name": "LastUpdateDays",
"Type": "Integer",
"Operator": "LessThan",
"CompliantValue": 30,
"RemediationStrings": {
"Language": "en_US",
"Title": "Security Agent Definitions Outdated",
"Message": "Security definitions are more than 30 days old. Connect to the corporate network or VPN to update automatically."
}
},
{
"Name": "ServiceRunning",
"Type": "String",
"Operator": "IsEquals",
"CompliantValue": "True",
"RemediationStrings": {
"Language": "en_US",
"Title": "Security Service Not Running",
"Message": "The security service is not running. Restart your computer or contact IT support if the issue persists."
}
}
]
}
Available operators include: IsEquals, NotEquals, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual.
Verification: Validate your JSON syntax using an online JSON validator or PowerShell: Get-Content SecurityAgentCompliance.json | ConvertFrom-Json
Pro tip: Use descriptive remediation messages that guide users to specific actions. Include links to internal portals or contact information where appropriate.