Remove-MsolDevice cmdlet in PowerShell removes a device object from Microsoft Office 365.
The syntax to remove a device object from the Azure Active Directory is given below.
Remove-MsolDevice -DeviceId <Guid> -ObjectId <Guid> [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
How to Remove a Device by Device ID in Office 365
To remove a device object by device ID in Office 365 with PowerShell, run the following command.
Remove-MsolDevice -DeviceId "44b30b26-aa3e-222c-3446-641fcf094fb1"
The Remove-MsolDevice cmdlet in PowerShell removes a device by device ID specified by the
-DeviceId parameter, in this case, “332A2AB4-6CD1-2A2B-AD12-C2A233AC26A7“. from Office 365.
How to Remove a Device by Object ID
To remove a device that is registered in your tenant by ObjectId, run the following command.
Remove-MsolDevice -ObjectId "332A2AB4-6CD1-2A2B-AD12-C2A233AC26A7"
The Remove-MsolDevice command removes the device with ObjectId “332A2AB4-6CD1-2A2B-AD12-C2A233AC26A7” from the Azure Active Directory.
I hope the above article on how to use the Remove-MsolDevice to delete a device from Office 365 is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.