We can enable active directory recycle bin feature on windows 2008 R2 Domain controller. We can enable this feature in either domain level or forest level. If we are going to enable this feature on forest level the forest functional level should be Windows 2008 R2.
Enable-ADOptionalFeature ‘Recycle Bin Feature’ –Scope ForestORConfigurationSet –Target ‘mydomain.lk’
This PowerShell cmdlet will enable ad recycle bin for you
Now im deleting user account “BranchAdmin”.This user is also member of a Administrators group.
Get-ADObject –IncludeDeletedObjects –Filter{name –like “Branch*”}
Using this Get-ADObject we can see what are the deleted accounts with account name like “branch*”
Now we can see all the deleted users in the active directory
Restore-ADObject –Identity 8923423423423424
Using Restore-ADObject we can restoer deleted users,but we need to provide those users GUID to the Restore-ADObject as a Idnetity Parameter
Branch admin user has restored with relevant group member ships.
This article is really very helpful. Its very well explained with the screen captures.