@Arif Usman In order to change the device owner, you would need to first add another owner to the device and then remove the existing user. There is no single PowerShell command to change the owner. I am sharing the cmdlets below:
- Open PowerShell as Administrator and run
Install-module AzureADPreview
. If you have this module installed already, you can skip this step. - Login to Azure AD with your Global Admin account by using
Connect-AzureAD
cmdlet. - Run
Get-AzureADDevice -All $true | Where-Object {$_.DeviceTrustType -eq "AzureAd"}
to get object ID of all Azure AD joined devices in your tenant. - Run
Add-AzureADDeviceRegisteredOwner -ObjectId 94b0b212-xxxx-xxxx-xxxx-xxxxxxxxxxxx -RefObjectId 86757ad2-xxxx-xxxx-xxxx-xxxxxxxxxxxx
. Where, -ObjectId is to specify the object id of the device and -RefObjectId is to specify the object ID of the user you want to add as registered owner. - Run
Remove-AzureADDeviceRegisteredOwner -ObjectId 94b0b212-xxxx-xxxx-xxxx-xxxxxxxxxxxx -OwnerId 540b9c12-xxxx-xxxx-xxxx-xxxxxxxxxxxx
. Where, -OwnerId is to specify the object ID of the previous owner that you want to remove. - To confirm the new registered owner, run
Get-AzureADDeviceRegisteredOwner -ObjectId 94b0b212-xxxx-xxxx-xxxx-xxxxxxxxxxxx
or login to Azure Portal and navigate to Azure AD > Devices > All devices.
-----------------------------------------------------------------------------------------------------------
Please "accept as answer" or "vote as helpful" wherever the information provided helps you to help others in the community.