Forum Discussion
Stephen Bell
Jun 11, 2018Iron Contributor
Quarantined Mobile Devices - Powershell
Hey Everyone -- I am trying to put together a Powershell script to approve a device that has been quarantined. By default, we quarantine everything and allow only what we want. $MobileDevice = ...
Cholsonic
Apr 10, 2019Copper Contributor
We were rolling out Android devices and wanted a way to allow all these whilst the roll out was happening. With help from this thread I wrote this;
$BlockedDevices = @(Get-MobileDevice -Filter 'DeviceAccessState -eq "Blocked"')
$BlockedDevices.Foreach({
Get-CASMailbox -Filter "ActiveSyncBlockedDeviceIDs -eq `'$($_.DeviceId)`'" | Set-CASMailbox -ActiveSyncAllowedDeviceIDs @{add=$($_.DeviceId)}
})
You would probably want to narrow down the Get-MobileDevice filter so BlockedDevices only contains the Devices you want allowing (DeviceModel for example if you are rolling out same hardware)
We ran it on a schedule during the rollout.
Hope this helps someone