Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Friday, October 29, 2010

How to recover and object from the AD Recycle Bin

Once you have activated your AD Recycle Bin, you can recover any deleted object from that point forward.

To recover a deleted object, open the PowerShell Console with the AD modules. To do this on Server 2008 R2, Click Start \ Active Directory MOdule for Windows PowerShell.

image

First we need to verify that the object is still in the AD Recycle bin. The account we are looking for in this example is User3. Type the following line in the Windows PowerShell console:

Get_ADObject – Filter {DisplayName –like “User*”} – IncludeDeletedObjects

image

We can see the full name of the object that we need to recover, User3.

Now type:

Get_ADObject – Filter {DisplayName –eq “User3”} – IncludeDeletedObjects | Restore-ADObject

A quick check of Active Directory Users and Computers will show the restored object and all of its properties.

image

No comments: