Find ActiveSync User by Device ID or IMEI

Have you ever needed to find out which user is using a given mobile device and all you have is the Device ID or IMEI code? The other way around is very simple but doesn’t really solve the problem.

I put together the following piece of code to simplify the operation:

$Mailboxes = Get-CASMailbox -ResultSize Unlimited | Where {$_.HasActiveSyncDevicePartnership -eq $True }
$User = $Mailboxes | %{Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity} | `?{$_.DeviceImei -like "0123456789ABCDEF"}
$User | fl Mailbox, DeviceType

You can of course substitute $_.DeviceImei with $_.DeviceId if that’s what you’re looking for.

Enjoy 🙂

Comments (4)

  1. Srinivas M says:

    Not working …

  2. menino says:

    gave only the devicetype

  3. Anonymous says:

    Or even..
    Get-ActiveSyncDevice | where {$_.deviceImei -like "01234567890ABCDEF"}

  4. Al says:

    Or even..
    Get-ActiveSyncDevice | where {$_.deviceImei -like "01234567890ABCDEF"}