I deleted one of the Organization Unit from my windows server 2012r2,but now i want to restore it how i can i restore it,is it possible through LDP or something else.


If you enabled AD Recycle Bin before, you can restore the OU first, then all the objects. Here is a step by step tutorial.

Basically, you need to restore the OU:

Get-ADObject -filter 'msds-lastKnownRdn -eq "MyOUName" -and lastKnownParent -eq "DC=MyDomain,DC=com"' -includeDeletedObjects | Restore-ADObject

And then the objects:

Get-ADObject -filter 'lastKnownParent -eq "OU=MyOUName,DC=MyDomain,DC=com"' -includeDeletedObjects | restore-adobject

If AD Recycle Bin wasn't enabled, you have to restore from a backup.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.