How to remove a device from Azure AD using the command line

How to use the Remove-AzureADDevice cmdlet to remove a device from Azure Active Directory (AD).

Remove-AzureADDevice
      -ObjectId <String>
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      [<CommonParameters>]

The Remove-AzureADDevice cmdlet removes a device from Azure Active Directory (AD). Example:

Remove-AzureADDevice -ObjectId "99a1915d-298f-42d1-93ae-71646b85e2fa"

  1. Connect to the Devices menu blade
Get the Device's object ID from Azure AD Devices blade
Get the Device’s object ID from Azure AD Devices

2. Select the device you want to remove, get the device’s Object ID.

Select the device, get the device's object ID
Select the device, get the device’s object ID

3. Run a Windows PowerShell using an administrator account.

4. Connect to Azure AD using the Connect-AzureAD command.

The Connect-AzureAD cmdlet connects an authenticated account to use for Azure Active Directory cmdlet requests. You can use this authenticated account only with Azure Active Directory cmdlets.

Connect-AzureAD
       [-AzureEnvironmentName <EnvironmentName>]
       [-TenantId <String>]
       [-Credential <PSCredential>]
       [-AccountId <String>]
       [-LogLevel <LogLevel>]
       [-LogFilePath <String>]
       [-InformationAction <ActionPreference>]
       [-InformationVariable <String>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Connect to Azure AD using the Connect-AzureAD command.
Connect to Azure AD using the Connect-AzureAD command.
Connection to Azure AD was successful
Connection to Azure AD was successful

5. Enter the Remove AzureADDevice command

Example:

Remove-AzureADDevice -ObjectId "99a1915d-298f-42d1-93ae-71646b85e2fa"
Connection to Azure AD was successful
Use the Remove-AzureADDevice command to remove the device. Reboot device.

6. Reboot the device.

Further reading: Remove-AzureADDevice

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Website Built with WordPress.com.

Up ↑

%d bloggers like this: