Quantcast
Channel: » Domain Controller
Viewing all articles
Browse latest Browse all 2

How to Restore Active Directory objects via Recycle Bin in windows server 2012

$
0
0

Active Directory Recycle bin provide the ability to restore Active Directory objects to the same consistent logical state that they were before deletion. For example restore a user account automatically restore all his group membership and the matching access rights that they had.

To restore an objects Active Directory Recycle Bin need to be enabled at the time of the deletion.

By default the Recycle Bin is Disable.

Before enabling Recycle Bin you need to consider the following:

  • To enable Recycle Bin you must first raise the forest functional level to Windows Server 2008 R2 or higher.
  • The process of enabling Active Directory Recycle Bin is irreversible

This post will guide you how to enable and restore an object via Active Directory Recycle Bin.

Enable Active Directory Recycle Bin

Enabling Recycle Bin in ADAC

1) Open ADAC by typing dsac.exe in the run line

2) Select the appropriate domain from the left panel of the screen. To add domain click on Manage, click Add Navigation Nodes and select the appropriate domain in the dialog box.

3) In the Task panel on the right click Enable Recycle Bin…

clip_image002

4) Click OK on the warning message box.

clip_image004

5) Refresh the ADAC by pressing F5.

Enabling Recycle Bin in PowerShell commands

Open PowerShell and type the following command without the brackets in the order shown:

  • Enable-ADOptionalFeature

clip_image006

  • (–Identity) ‘CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=Direct-Lab,DC=local’

clip_image008

  • (–Scope) ForestOrConfigurationSet

clip_image010

  • (–Target) ‘Direct-Lab.local’

clip_image012

Restoring deleted objects

Restoring deleted objects via ADAC

1) Open ADAC by typing Dsac.exe in the run line

2) Select the appropriate domain from the left panel of the screen.

To add domain click on Manage, click Add Navigation Nodes and select the appropriate domain in the dialog box.

3) Navigate to the Deleted Object container

clip_image014

4) Select the appropriate user and click restore at the Tasks panel to restore the user to the original container,

click “restore to…” to select the container that will contain the user after the restore.

clip_image016

Restoring deleted objects via PowerShell

Open PowerShell and type the following command without the brackets in the order shown:

For restoring to the original container

    • Get-ADObject  –IncludeDeletedObjects | Restore-ADObject

    • (–Filter) ‘Name –Like "*Direct*"

    For restoring to specified container add

      • Get-ADObject  –IncludeDeletedObjects | Restore-ADObject |–TargetPath "OU=DirectOU,DC=Direct-Lab,DC=local"

      • (–Filter) ‘Name –Like "*Direct*"

      clip_image018

       

      This post whose writing by Direct Experts

      Phone: +972-73-727-4010 | Email: info@direct-ex.co.il | Web: www.direct-ex.co.il

      image


      Viewing all articles
      Browse latest Browse all 2

      Trending Articles