• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1047
  • Last Modified:

Exchange cmdlets to manage ActiveSync devices?

When going into the ECP and looking at a users mailbox, I go into their Mobile Devices to remove a device that the user no longer uses, but I get the following error;

The ActiveSyncDevice b8e0a9c0-44b3-4438-9f14-e918fe34dc1d cannot be found.

What are the cmds that I could use to force the device removal from the Exchange 2010 Server?

Is there a script somewhere that I could use?

At this point I cant block or delete the device.

Thanks in advance.
1 Solution
Stelian StanNetwork AdministratorCommented:
Vaseem MohammedCommented:
Recently I worked on a simple script to find ActiveSync devices for all mailboxes based on last successful sync

$mbx = get-casmailbox -resultsize unlimited | where {$_.HasActiveSyncDevicePartnership -eq $true};

$mbx | foreach {
“Processing: “+$_.name
$name = $_.name;
$Devices = get-activesyncdevicestatistics -mailbox $_.identity | where {$_.LastSuccessSync -le (Get-Date).AddDays("-30")};
foreach($Device in $Devices){
” Device: “+$Device.DeviceType
$Report += $Device
 $Report | Export-Csv -path c:\powershell\staledevices.csv -NoTypeInformation

Open in new window

To Delete the records which are older than 30 days (exported above)
Import-Csv -path c:\powershell\staledevices.csv |foreach {remove-activesyncdevice -identity $_.guid -confirm:$false}

Open in new window

see if it suites your needs.
Have you moved this user to new OU? You can refer the following article which explains how to remove the ActiveSync device partnerships using Remove-ActiveSyncDevice. Please let us know if you have any questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Tackle projects and never again get stuck behind a technical roadblock.
Join Now