microsoft/Intune-PowerShell-SDK

Help with policy creation

shortNviolent opened this issue · 1 comments

New-IntuneDeviceCompliancePolicy -displayName "Apple (Personal Device)" -iosCompliancePolicy -passcodeBlockSimple $true -passcodeExpirationDays 180 -passcodeMinimumLength 6 -passcodeMinutesOfInactivityBeforeLock 2 -passcodePreviousPasscodeBlockCount 3 -passcodeRequiredType numeric -passcodeRequired $true -osMinimumVersion 14 -securityBlockJailbrokenDevices $true -scheduledActionsForRule (New-DeviceComplianceScheduledActionForRuleObject -ruleName PasswordRequired -scheduledActionConfigurations (New-DeviceComplianceActionItemObject -gracePeriodHours 0 -actionType block -notificationTemplateId ""))
Works but I also need to add another action to send a push notification to the users device. I am stuck trying to work out:

  1. how to actually create that rule but thing it goes something like this:

(New-DeviceComplianceScheduledActionForRuleObject -ruleName PasswordRequiredNotification -scheduledActionConfigurations (New-DeviceComplianceActionItemObject -gracePeriodHours 0 -actionType notification -notificationTemplateId ""))

  1. Can you tell me with the above how to build the object when having 2 rules. I created a hash table with both rules within but that did not work.

Thanks so much

I solved it just after I posted. I was close above and realized what it was, thanks.