Не проверено мной, но, прочитав документацию, это должно работать:
# parameter Mailbox can use any of these user properties:
# Name
# Alias
# Distinguished name (DN)
# Canonical DN
# <domain name>\<account name>
# Email address
# GUID
# LegacyExchangeDN
# SamAccountName
# User ID or user principal name (UPN)
# get the list of devices for your user and loop through, removing them one-by-one
Get-ActiveSyncDevice -Mailbox "the.user@yourcompany.com" | ForEach-Object {
$_ | Remove-ActiveSyncDevice -WhatIf
}
Exchange 2013 или более поздней версии
Get-MobileDevice -Mailbox "the.user@yourcompany.com" | ForEach-Object {
$_ | Remove-MobileDevice -WhatIf
}
Когда вас устраивает информация, отображаемая в консоли,удалите переключатель -WhatIf
, чтобы на самом деле код удалил устройства.