E14–Remote ActiveSyncDevice

 

http://thoughtsofanidlemind.com/2014/01/15/eas-device-partnerships/

http://www.symantec.com/connect/forums/script-remove-stale-exchange-activesync-device-partnerships-mobile-management-implementation


[PS] >Get-ActiveSyncDeviceStatistics -Mailbox johnny.yao | ft DeviceFriendlyName,DeviceOS,LastSuccessSync

image


[PS] >Get-ActiveSyncDevice -Mailbox johnny.yao | ft FriendlyName, DeviceModel, DeviceType, DeviceOS

image[


[PS] >

$Mbx = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited

$Mobile = $Mbx | %{Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity}

$Mobile | Group-Object -Property DeviceType –NoElement

$Mobile | Group-Object -Property DeviceOS –NoElement

$Mobile | Group-Object -Property DeviceFriendlyName –NoElement


[PS] >Get-CASMailbox -ResultSize Unlimited -Filter {(HasActivesyncDevicePartnership -eq $false)} -OrganizationalUnit Users | ft name


[PS] >Get-ActiveSyncDeviceStatistics -Mailbox Johnny.yao | Where-Object {$_.LastSuccessSync -le (Get-Date).AddDays("-180")} | ft DeviceFriendlyName, DeviceModel, DeviceType, DeviceOS

image


[PS]>$DeviceToRemove = Get-ActiveSyncDevice -Mailbox johnny.yao | Get-ActiveSyncDeviceStatistics | Where {$_.LastSuccessSync -le (Get-Date).AddDays("-180") }

[PS] >Echo $DeviceToRemove | ft DeviceFriendlyName,DeviceType,DeviceModel,DeviceOs

image

[PS] >Echo $DeviceToRemove | ft DeviceFriendlyName,DeviceType,DeviceModel,DeviceOs,LastSuccessSync

image


image


http://exchangeserverpro.com/exchange-2010-error-activesyncdevice-cannot-be-found-remote-wipe/ 

Remote Wipe



param (

[parameter(mandatory=$true, ValueFromPipeline=$true)]
[string]$user

)

$mailbox = Get-Mailbox $user
$name = $mailbox.Name
$easdevices = @(Get-ActiveSyncDevice | where {$_.UserDisplayName -like "*$name"})

$count = $easdevices.count

Write-Host -ForegroundColor Yellow "$count ActiveSync devices found for $mailbox"

foreach ($easdevice in $easdevices)
{
$easdevstats = Get-ActiveSyncDeviceStatistics $easdevice

if ($($easdevice.Identity.ToString()) -eq $($easdevstats.Identity.ToString()))
{
Write-Host -ForegroundColor Green "IDs match, normal remote wipe process should work."
}
else
{
Write-Host -ForegroundColor Red "IDs don't match"
Write-Host $easdevice.Identity
Write-Host $easdevstats.Identity

Clear-ActiveSyncDevice -Identity $easdevice.identity

}
}



[PS] C:\>Get-ActiveSyncDeviceStatistics -Mailbox johnny.yao | ft Identity




image



image



 



 





Comments

Popular posts from this blog

E15 CU3–Update Failed–AD replicated Exceeded the tombstone lifetime.

202301 - Exchange onpreme - PowerShell Serialization Payload Signing

E14–Bulk Create Mail Contact & Set-Contact