Restore Deleted Active Directory User

by Robert Allen

In this article, I’ll show you how to restore deleted Active Directory user accounts. You can recover deleted AD Users without a backup by using native Microsoft Tools. There are two options when restoring with native tools and there is a huge difference that you must know.

In this article.

Must Read! Important Details about Deleted AD Users

  1. If you have deleted users and then enabled the AD Recycle Bin you will not be able to recover them. You will first need to restore them without using the AD Recycle Bin (See option 1). If you have deleted users and then enable the recycle bin the only way to restore them is from a backup.
  2. Enabling the AD Recycle Bin allows you to restore user accounts after it is enabled.
  3. Once the AD Recycle Bin is enabled, you cannot disable it.
  4. Deleted objects (without AD Recycle Bin) are saved for the period set in the tombestonelifetime (default 180 days).
  5. Deleted objects (with AD Recycle Bin) are saved for the time period set in the Deleted Object Lifetime attribute (msDS-deletedObjectLifetime), which is equal to the Recycled Object Lifetime period (default 180 days).
  6. Restoring a deleted users without the AD Recycle will not preserve most user settings. It will preserve the SID.
  7. Restoring with the AD Recycle bin will preserve user settings.

Option 1. Restore AD User without AD Recycle Bin Enabled

Note: When restoring accounts without the AD Recycle Bin all user details are lost. The good news is it will preserve the users SID.

You can check if the AD Recycle Bin is enabled with the below command.

Get-ADOptionalFeature -Filter 'Name -like "Recycle Bin Feature"'

If the EnabledScopes is empty, then AD Recycle bin is not enabled.

check ad recycle bin status

I’m going to delete the account below. Notice the details on the account, when I restore it not all the details are lost.

user properties

Step 1. Get a list of deleted users

Use the Get-ADObject cmdlet to get a list of deleted users.

Get-ADObject -IncludeDeletedObjects -Filter 'IsDeleted -eq $true -and ObjectClass -eq "user"'
get-adobject powershell

I can see the “Robert Allen” account that I want to restore. I’ll copy the ObjectGUID and use it in step 2 to restore the account.

Step 3. Restore deleted user

Use the Restore-ADObject cmdlet to restore the account. You have to specify a new name for the account.

Restore-ADObject -Identity "22c35e0e-719b-4243-a3b6-ab14e7732d13" -NewName "Robert Allen22"

I’ve successfully restored the account now let’s look at it in Active Directory.

Everything is missing!!

restore ad user powershell

As you can see the drawback to restoring without the AD Recycle bin is it does not preserve the user properties. It’s useful though if you need to retain the users SID.

Option 2. Restore AD User using the AD Recycle Bin

If you have deleted users and then enabled the AD Recycle Bin you will not be able to recover them. They will be destroyed. You will first need to restore them without using the AD Recycle Bin (See option 1).

Follow the steps below to restore objects with the AD Recycle bin.

  1. Open Active Directory Administrative Center
  2. Click on your domain
  3. Select “deleted objects”
  4. Select the account and click restore.
restore user with ad recycle bin

When you restore with the recycle bin it restores all users details.

example of restored ad user

Refer to the article How to enable Active Directory Recycle bin for complete steps on enabling the AD recycle bin

Option 3. Restore AD user using AD Pro Toolkit

You can easily restore deleted users with the AD Pro Toolkit.

This requires the AD Recycle Bin to be enabled.

To restore an account with the AD Pro Toolkit follow these steps.

  1. Click on Restore Deleted Users
  2. Select the account
  3. Click the restore button.
user restore with ad pro toolkit

Full disclosure, restoring with the toolkit does the exact same thing as restoring from the Active Directory Administrative Center. The benefit of using the toolkit is you can manage AD from one central application.

References

Leave a Comment