So I'm working to cleanup stale mobile devices using a script and Remove-MobileDevice but before I do this, I ran a test with my active mobiledevice to test the experience should one of the stale devices reconnect.
Before I started, I ran Get-MobileDeviceStatistics to get my device's GUID that I then used in Remove-MobileDevice. I successfully removed the mobile device.
My hope was my phone would simply reconnect when finished, and it did as I can see it still pulling down email. But here is my problem.
When I run get-mobiledevicestatistics to verify my device is still syncing, it still lists the same GUID as the device I previously removed and if I try to run get-mobiledevice with this GUID it fails. So I ran a Get-MobileDevice using the same Identity and show the GUID there is completely different. How is this possible??
[PS] C:\scripts\Exchange>Get-MobileDeviceStatistics -Mailbox "MyUser" | sort-object -Descending lastsuccesssync | ft lastsuccesssync,devicetype,deviceid,deviceuseragent,guid LastSuccessSync DeviceType DeviceID DeviceUserAgent Guid --------------- ---------- -------- --------------- ---- 9/4/2018 2:28:29 PM SamsungDevice SEC<redacted>5784 Android-SAMSUNG-SM-G950U/101.80000 05d5c314-82eb-45db-a041-e7afccf146fe [PS] C:\scripts\Exchange>Remove-MobileDevice -identity "05d5c314-82eb-45db-a041-e7afccf146fe" Confirm Are you sure you want to perform this action? Removing mobile device "<redacted>/MyUser/ExchangeActiveSyncDevices/SamsungDevice§SEC<redacted>5784". All information about this mobile device will be removed. It must be re-synchronized. [Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): Y [PS] C:\scripts\Exchange>Get-MobileDeviceStatistics -Mailbox "MyUser" | sort-object -Descending lastsuccesssync | ft lastsuccesssync,devicetype,deviceid,deviceuseragent,guid LastSuccessSync DeviceType DeviceID DeviceUserAgent Guid --------------- ---------- -------- --------------- ---- 9/4/2018 3:47:17 PM SamsungDevice SEC<redacted>5784 Android-SAMSUNG-SM-G950U/101.80000 05d5c314-82eb-45db-a041-e7afccf146fe [PS] C:\scripts\Exchange>get-mobiledevice -identity "<redacted>/MyUser/ExchangeActiveSyncDevices/SamsungDevice§SEC<redacted>5784" | ft identity,guid Identity Guid -------- ---- <redacted>/MyUser/ExchangeActiveSyncDevices/SamsungDevice§SEC<redacted>5784 0b30ecec-3e53-4f6f-af21-98cce50edc41