The script wipes all mobile devices of the target mailbox. The script can be executed in a custom command, business rule or scheduled task.
PowerShell
# Get mailbox parameters
$mailboxParams = $Context.TargetObject.GetMailParameters("ADM_GET_EXCHANGE_PARAMS_FLAGS_NONE")
# Get active sync feature
$activeSync = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_ACTIVESYNC")
# Wipe all mobile devices
foreach ($mobileDevice in $activeSync.MobileDevices)
{
$mobileDevice.WipeStatus = "ADM_MOBILE_DEVICE_WIPE_STATUS_WIPEPENDING"
}
# Save changes
$Context.TargetObject.SetMailParameters($mailboxParams, "ADM_SET_EXCHANGE_PARAMS_FLAGS_NONE")
Thnx Remco
To perform the wipe, Adaxes uses the Clear-MobileDevice cmdlet which deletes all data from a mobile phone. For more details about the cmdlet, have a look at the following Microsoft article: https://docs.microsoft.com/en-us/powershell/module/exchange/clear-mobiledevice?view=exchange-ps.
Thnx remco
It can only be done by using the Clear-MobileDevice cmdlet itself in the script. For information on how to connect to Exchange in PowerShell scripts executed in Adaxes, have a look at the following article in our repository: https://www.adaxes.com/script-repository/connect-to-exchange-with-powershell-s506.htm.
Unfortunately, there is still no such possibility. It can only be done by directly using the Clear-MobileDevice cmdlet.