Unable to delete device from Azure AD

Tom Esler 5 Reputation points
2023-03-29T01:17:53.25+00:00

I have a single device that is not found in our Azure AD, but shows up in the device list. I was able to rename the device and join the PC once renamed, but this rouge device still remains in my device list. I also tried to remove the device from PS with no success stating it wasn't found in the AD. Before renameing the PC I was getting an error when joining that the device already existing. Any help would be appreciated.

{ "shellProps": { "sessionId": "43fa2f512ad04f8a82cc5ad41f7146e5", "extName": "Microsoft_AAD_Devices", "contentName": "DeviceDetailsBlade", "code": 404 }, "error": { "message": "Device with ID 57414bd6-d6d0-4330-a296-804f86c5db61 was not found in Azure AD. If this device was just joined or registered, please try again in a couple of minutes.", "code": 404 }}

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Ayomide Oluwaga 906 Reputation points
    2023-03-29T18:13:33.0233333+00:00

    Hello @Tom Esler Welcome to the Q&A,

    You are not alone in this issue actually, I might say I have seen it a couple of times. This problem arises when the old device record was not properly removed from Azure AD.

    Here are some steps you can try to mitigate the issue:

    1. Check if the device has been deleted in Azure AD using PowerShell command Get-AzureADDevice -All:$true | Where-Object {$_.DisplayName -eq 'old_device_name'}. Replace old_device_name with the name of the old device. If the device still appears, note the Object ID of the device.
    2. Try to remove the device using the Object ID noted in the previous step, by running Remove-AzureADDevice -ObjectID <Object ID>. This command should remove the device from Azure AD.
    3. If the device cannot be removed using the Object ID, try removing it using the device's hardware ID instead. Run Get-AzureADDeviceRegisteredOwners -ObjectId <Object ID> to retrieve the hardware ID of the device. Then, run Get-AzureADDevice -All:$true | Where-Object {$_.AlternativeSecurityIds -match '<hardware ID>'} to retrieve the Object ID of the device. Finally, run Remove-AzureADDevice -ObjectID <Object ID> to remove the device from Azure AD.

    if this helps solve your issue, please let me know. I will be on standby incase you have further questions.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.