-->

Wednesday, January 8, 2014

Bulk Cleaning up Old/Stale ActiveSync Devices in Exchange 2010

Mobile devices are now a staple of business and BYOD (Bring Your Own Device) is becoming more and more common.
The problem this presents is that, as users get new mobile phones, Exchange 2010 isn't automatically removing or cleaning up the old ones. It's up to the user to remove their old phones in OWA...yeah like that'll ever happen. ;)

I have two PowerShell scripts that'll help you remove those stale devices in bulk and keep your Exchange clean.


The first script, which you can grab from my
Google Drive will find and export a CSV list of devices that haven't connected to Exchange in 30 days.

Save the script to your Exchange Scripts directory.

Then, fire up the Exchange Management Shell and change to the scripts directory:

cd $exscripts

Then, run:


FindOldActiveSyncDevices.ps1

It will output the CSV file to your C: drive, which you can review if you want.

The next script, which is also on my Google Drive, will use that CSV and clean/remove the stale devices that were listed.

Save the script to your Exchange Scripts directory.

Then, fire up the Exchange Management Shell and change to the scripts directory:

cd $exscripts

Then, run:


CleanOldActiveSyncDevices.ps1

Exchange will now be clean of old mobile phones! 

If you happen to have users who take extended vacations lasting longer than the 30 day limit in the script, it will have no adverse effects on their devices...they will automatically be re-added when they connect again.

No comments:

Post a Comment