Microsoft Security Tech Accelerator
Dec 06 2023, 07:00 AM - 12:00 PM (PST)
Microsoft Tech Community

How to recover or re-add device

Copper Contributor


To try and make a long story short, I have 2 devices, Device 1 one belonged to me and Device 2 belonged to someone previously. I had taken Device 2 because the specs we're better and am giving Device 1 to a new-hire. My initial thought was to delete Device 1 and just re-add it to Azure AD under the new owner. After I had done that I came across an extremely simple PowerShell cmdlet that made adding a new owner and removing the old owner very fast and painless. I used this cmdlet to add me as the new owner of Device 2 but had already deleted Device 1. I'm now stuck trying to figure out how to get Device 1 back into AD and change the owner. How can I do this?


9 Replies
Hi Luke,

I have been in the same boat sometime ago. Recycle bin is not yet supported and you can’t recover deleted devices, it’s a feature that MSFT working on.

All the devices stays on soft delete for 30 days, I know because when I delete a device from Azure AD, It stays in PowerBI report for 30 days.

Have you tried the ps below to add the device manually?

PS C:\>New-AzureADDevice -AccountEnabled $true -DisplayName "My new device" -DeviceId $guid -DeviceOSType "OS" -DeviceOSVersion "1.1"

Hi, @Moe_Kinani 

From looking at the command I assume this makes a spare device on AD to which I can then add the device to the already existing user?


It’s the only workaround in your situation.

I was able to resolve this using the following steps:

For Azure AD joined devices Windows 10 devices, take the following steps:

Open the command prompt as an administrator
Enter dsregcmd /forcerecovery (You need to be an administrator to perform this action).
Click “Sign in” in the dialog that opens up and continue with the sign in process.
Sign out and sign in back to the device to complete the recovery.

Just for good measure I gave user temporarly administrator priviledges & followed the steps initially to remove the device


1) dsregcmd /debug /leave
2) Reboot
3) Add user to local-admins
4) Log-off & on again
5) dsregcmd /forcerecovery (I was unable to use the GUI, it did not “work” e.g. no sign-in screen showed.)


I used this for:


Fix Office 365 Error 70003: Your Organization Has Deleted This Device - Technipages


It might resolve your issue aswell

I deleted the device from my AzureAD and wanted the new named device to show here and the above solution worked for me. thank you.
me too!
I had a similar problem with a computer where the device had been deleted on AzureAD by mistake. Found using "dsregcmd /forcerecovery" worked for me.

Was a few seconds away from resetting the PC as nothing else had worked when I spotted this suggestion. Saved me a lot of time and have made a note of the command in case it occurs on another device.



This saved me. I accidentally deleted a device from the admin portal and my employee could not recieve emails. The "dsregcmd /forcerecovery" wouldn't launch until the user was set up as an admin, and on a fresh restart. We are up and running now. Thank you!!!

dsregcmd /forcerecovery on the cmd line worked PERFECTLY! Thanks so much