{
"PolicyName": "Update Jobs - Add Maintenance Job",
"PolicyType": "JobUpdate",
"PolicyId": "REPLACE_WITH_ID",
"Status": "on",
"Actions": {
"OnSuccess": {
"Controls": [
"NOTIFY"
]
},
"OnFailure": {
"Command": ""
}
},
"NotificationMessage": "A job was added to this endpoint via policy.",
"NotificationRequiresAcknowledge": false,
"RiskLevel": 20,
"Operator": "And",
"Rules": [
{
"RuleName": "UserCheck",
"ErrorMessage": "This user is not included in this policy",
"RuleExpressionType": "BuiltInAction",
"Expression": "CheckUser()"
},
{
"RuleName": "MachineCheck",
"ErrorMessage": "This Machine is not included in this policy",
"RuleExpressionType": "BuiltInAction",
"Expression": "CheckMachine()"
}
],
"UserCheck": [],
"MachineCheck": [],
"ApplicationCheck": [],
"DayCheck": [],
"DateCheck": [],
"TimeCheck": [],
"CertificationCheck": [],
"Extension": {
"JobId": "my-maintenance-job",
"Action": "Add",
"JobJson": "{\n \"id\": \"my-maintenance-job\",\n \"name\": \"My Maintenance Job\",\n \"description\": \"Runs periodic maintenance actions.\",\n \"enabled\": true,\n \"schedule\": {\n \"type\": \"interval\",\n \"minutes\": 60\n },\n \"tasks\": [\n {\n \"type\": \"command\",\n \"name\": \"Example Task\",\n \"command\": \"echo Maintenance job ran\"\n }\n ]\n}"
}
}