I have more than 1100 Windows devices registered on Intune, some users had their laptop replaced, however the device replaced was not deleted. How can I generate a list of UPN that contains more than 1 device? I will need this check this list and then remove it from On-Prem AD, AAD, Intune.
I was trying to create a PowerShell script, but I am not finding a way to do that.
$intuneDevices = Get-IntuneManagedDevice | Get-MSGraphAllPages $windevices = $intuneDevices | Where-Object { $.operatingSystem -eq "Windows" } $windevices | **Where-Object {$.userPrincipalName -ge '1'}* | Select DeviceName, userPrincipalName * I am not sure exactly how I can bring userPrincipalName with more than 1 device.
I hope it make sense and someone can help
Thanks in advance TZ