Remove-AzureADDeviceRegisteredOwner (AzureAD) | Microsoft Learn
$device = Get-AzureADDevice -SearchString "lt3320"
$Owner = Get-AzureADDeviceRegisteredOwner -ObjectId $Device.ObjectId
Remove-AzureADDeviceRegisteredOwner -ObjectId $Device.ObjectId -OwnerId $Owner.ObjectId
Get-AzureADDeviceRegisteredOwner -ObjectId 4e18a2f9-a4e1-4a44-b573-1cd9ff810b3c | fl
The first command gets a device by using the Get-AzureADDevice (./Get-AzureADDevice.md)cmdlet, and then stores it in the $Device variable.
The second command gets the registered owner for the device in $Device by using the Get-AzureADDeviceRegisteredOwner (./Get-AzureADDeviceRegisteredOwner.md)cmdlet. The command stores it in the $Owner variable.
The final command removes the owner in $Owner from the device in $Device.