Remove-EntraDevice
Deletes a device.
Syntax
Remove-EntraDevice
-DeviceId <String>
[<CommonParameters>]
Description
The Remove-EntraDevice
cmdlet removes a device from Microsoft Entra ID.
In delegated scenarios with work or school accounts, the signed-in user must have a supported Microsoft Entra role or a custom role with the required permissions. The following least privileged roles are supported:
- Intune Administrator
- Windows 365 Administrator
- Cloud Device Administrator
Examples
Example 1: Remove a device
Connect-Entra -Scopes 'Directory.AccessAsUser.All', 'Device.ReadWrite.All'
$device = Get-EntraDevice -Filter "DisplayName eq 'Woodgrove Desktop'"
Remove-EntraDevice -DeviceId $device.ObjectId
This command removes the specified device.
Parameters
-DeviceId
Specifies the object ID of a device in Microsoft Entra ID.
Type: | System.String |
Aliases: | ObjectId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |