Tag Archives: json

Intune: Graph API with Json

The Microsoft Graph API is a very powerful way to consume, integrate and interact with Microsoft Cloud services.

With a few scripts or PowerShell lines you’ll be able to setup many of the policies within Intune.

The below example is a Json for a compliance policy to iOS devices, and by combining that with some scripting from gihub you’ll be able to do a Intune setup in no time.

$odata = “@odata.type”
$iOSpolicy =
@{
$odata = “#microsoft.graph.iosCompliancePolicy”
“description”= “Created using Microsoft Graph”
“displayName”= “iOS Compliance Policy”
“passcodeBlockSimple”= $true
“passcodeExpirationDays”= 90
“passcodeMinimumLength”= 8
“passcodeMinutesOfInactivityBeforeLock”= 5
“passcodePreviousPasscodeBlockCount”= 2
“passcodeMinimumCharacterSetCount”= 0
“passcodeRequiredType”= “alphanumeric”
“passcodeRequired”= $true
“osMinimumVersion”= “9.0”
“osMaximumVersion”= “11.0”
“securityBlockJailbrokenDevices”= $true
“deviceThreatProtectionEnabled”= $true
“deviceThreatProtectionRequiredSecurityLevel”= “low”
}