Steps to restore deleted Active Directory contacts using PowerShell

The following is a comparison between restoring a deleted AD contact object with Windows PowerShell and RecoveryManager Plus.

Windows PowerShell

Prerequisite: The native Recycle Bin in Active Directory has to be enabled.

Identify the Distinguished Name of the contact object using the following script.

(Get-ADObject -SearchBase
(get-addomain).deletedobjectscontainer
-IncludeDeletedObjects -filter "(givenName –eq
‘%Object_Name%’) –and (objectClass –wq ‘contact’)") Where %Object_Name% is the givenName of the contact object.
Click to copy the script

Copy the DN of the contact object and execute the following script.

Restore-ADObject -Identity $dn

Where $dn is the Distinguished Name of the contact object that you found out in the previous step.

Click to copy the script

RecoveryManager Plus

To restore a deleted computer object,

Navigate to Active Directory tab > Recycle Bin.

Select the deleted contact object and click Restore.

Screenshot

Restore AD contacts

» Start 30-day Free Trial

Following are the limitations in restoring AD contact objects using Windows PowerShell:

  • The native AD Recycle Bin has to be enabled for restoration using PowerShell to work. Once the native Recycle Bin has been enabled, it cannot be disabled. On the other hand, RecoveryManager Plus's Recycle Bin does not require the native Recycle Bin to be enabled.
  • The contact to be restored cannot be previewed before restoration, whereas in RecoveryManager Plus you can preview all attribute values that will be restored when you restore a contact.
  • You can only restore contact to the last known state before they were deleted but with RecoveryManager Plus, you can choose to restore individual attributes of the contacts to any of their previous state.

Overcome the limitations of PowerShell by using
RecoveryManager Plus to restore deleted objects.

  •  
     
  •  
  • By clicking 'Download now', you agree to processing of personal data according to the Privacy Policy.

Thank you for downloading!

Your download should begin automatically in 15 seconds. If not, click here to download manually.

  • Embark on your script-free AD Self-service password management with ADSelfService Plus.
  •  
  • By clicking 'Get your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thank you for downloading!

    Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Resources

A single pane of glass for Active Directory, Azure Active Directory,
Microsoft 365, Google Workspace, and Exchange Backup.
  • » Personal WorkDrive backup
  • » Backup retention
  • » Incremental backup