Exchange management shell offers cmdlets to manage ActiveSync devices:
To see all ActiveSync devices that are connected (or have ever been connected) to the mailbox user use the following command:
Get-ActiveSyncDevice -Mailbox Mailbox | fl *device*
…………
DeviceId : HTC14b71389864f33d5f4ea6dc1dbb4f
DeviceImei :
DeviceMobileOperator :
DeviceOS : Android 2.3.3
DeviceOSLanguage :
DeviceTelephoneNumber :
DeviceType : htcbravo
DeviceUserAgent : Android-EAS/3.10.000.083346.405
DeviceModel : htcbravo
DeviceAccessState : Allowed
DeviceAccessStateReason : Global
DeviceAccessControlRule :
DeviceActiveSyncVersion : 12.1
…………
The parameter "DeviceId" contains a string, which is to be used in the next command. Use this command below to lock the device with DeviceID for the Mailbox:
Set-CASMailbox Mailbox -ActiveSyncBlockedDeviceIDs HTC14b71389864f33d5f4ea6dc1dbb4f
To verify the result re-run the first command:
Get-ActiveSyncDevice -Mailbox Mailbox
…………
DeviceId : HTC14b71389864f33d5f4ea6dc1dbb4f
DeviceImei :
DeviceMobileOperator :
DeviceOS : Android 2.3.3
DeviceOSLanguage :
DeviceTelephoneNumber :
DeviceType : htcbravo
DeviceUserAgent : Android-EAS/3.10.000.083346.405
DeviceModel : htcbravo
DeviceAccessState : Allowed
DeviceAccessStateReason : Global
DeviceAccessControlRule :
DeviceActiveSyncVersion : 12.1
…………
The parameter "DeviceId" contains a string, which is to be used in the next command. Use this command below to lock the device with DeviceID for the Mailbox:
Set-CASMailbox Mailbox
To verify the result re-run the first command:
Get-ActiveSyncDevice -Mailbox Mailbox | fl *device*
…………
DeviceId :
HTC14b71389864f33d5f4ea6dc1dbb4f
DeviceImei :
DeviceMobileOperator :
DeviceOS : Android 2.3.3
DeviceOSLanguage :
DeviceTelephoneNumber :
DeviceType : htcbravo
DeviceUserAgent : Android-EAS/3.10.000.083346.405
DeviceModel : htcbravo
DeviceAccessState : Blocked
DeviceAccessStateReason : Global
DeviceAccessControlRule :
DeviceActiveSyncVersion : 12.1
…………
Also the blocked DeviceId appears in the list of the blocked device IDs for the mailbox:
Get-CASMailbox Mailbox | fl ActiveSync*
…………
ActiveSyncAllowedDeviceIDs : {}
ActiveSyncBlockedDeviceIDs : {
HTC14b71389864f33d5f4ea6dc1dbb4f }
ActiveSyncMailboxPolicy : Default
ActiveSyncMailboxPolicyIsDefaulted : True
………
The next try to access the mailbox with the blocked device will fail and the user will receive an e-mail from the Exchange server that will notify the user about the locked device.
To reset the blocked device list for a user mailbox enter the following command:
Set-CASMailbox Mailbox -ActiveSyncBlockedDeviceIDs $nul
DeviceImei :
DeviceMobileOperator :
DeviceOS : Android 2.3.3
DeviceOSLanguage :
DeviceTelephoneNumber :
DeviceType : htcbravo
DeviceUserAgent : Android-EAS/3.10.000.083346.405
DeviceModel : htcbravo
DeviceAccessState : Blocked
DeviceAccessStateReason : Global
DeviceAccessControlRule :
DeviceActiveSyncVersion : 12.1
…………
Also the blocked DeviceId appears in the list of the blocked device IDs for the mailbox:
Get-CASMailbox Mailbox | fl ActiveSync*
ActiveSyncAllowedDeviceIDs : {}
ActiveSyncBlockedDeviceIDs : {
ActiveSyncMailboxPolicy : Default
ActiveSyncMailboxPolicyIsDefaulted : True
………
The next try to access the mailbox with the blocked device will fail and the user will receive an e-mail from the Exchange server that will notify the user about the locked device.
To reset the blocked device list for a user mailbox enter the following command:
Set-CASMailbox Mailbox
The command above allows all devices for a user mailbox.
Great post Hermann
Leo Santini
28 November, 2016 16:32Thank you. I used what you shared today...in 2018!
Unknown
10 January, 2018 16:47Wow :)
This is an incredible collection of ideas!
Waiting for more helpful pieces.
You would amazing to read a similar one here-
besttoolsbrand
Ash Green
23 April, 2020 13:28