This script removes orphaned ActiveSync device partnerships from Exchange Server 2010 user mailboxes. Run the script as a scheduled job to maintain your Exchange Server environment properly.
Modifiy the script path variables to fit your requirements. The variables are configured in the ### BEGIN Variables section.
Steps being executed by the script:
- Fetch all user mailboxes
- Iterate through each user mailbox and determine the number of ActiveSync devices and the number of devices which have not synchronized since 150 days
- Delete ActiveSync device registration, if a user has more than 4 devices in total and a minimum of 1 device that has not synced within 150 days
- 1.0, Initial community release
- Download and follow at Github: https://github.com/Apoc70/Remove-ActiveSyncDevicePartnership
- Download and like at TechNet Gallery: https://gallery.technet.microsoft.com/Cleanup-ActiveDync-device-5ee32087
Additional credits go to Sebastian Rubertus