Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form

Restore AD Objects: How to restore deleted user accounts in Active Directory with Microsoft LDP and PowerShell

Posted on 21/11/202030/08/2026 Christian By Christian No Comments on Restore AD Objects: How to restore deleted user accounts in Active Directory with Microsoft LDP and PowerShell
  1. Home
  2. Windows Server
  3. Restore AD Objects: How to restore deleted user accounts in Active Directory with Microsoft LDP and PowerShell
Restore AD Objects

Active Directory (AD) is a widely used directory system, the ability to restore unwanted changes in your AD infrastructure is crucial. When AD objects are deleted, they are placed in the Deleted Objects container (AD recycle bin). There are several methods to restore deleted user accounts, computer accounts, and security groups. For some related content on Active Directory, see the following guides, “AD Authentication methods: Kerberos and NTLM, Concept of AD Computer Account, how to remove Microsoft Exchange Server from AD, and also “the sign-in method you are trying to use is not allowed”, and for a detailed list of articles on Active Directory, visit the following link“.

These objects are known collectively as security principles. By default, this container is not displayed to an administrator and it must be enabled manually either using either PowerShell, ADAC, or via the LDP.exe utility.

AD Recycle Bin starting in Windows Server 2008 R2 builds on the existing tombstone reanimation infrastructure and enhances your ability to preserve and recover accidentally deleted AD objects.

When you enable AD Recycle Bin, all link-valued and non-link-valued attributes of the deleted AD objects are preserved and the objects are restored in their entirety to the same consistent logical state that they were in immediately before deletion, e.g., all group memberships and corresponding access rights that they had immediately before deletion, within and across domains. Active Directory Recycle Bin works for both AD DS and AD LDS environments

Windows Server Account Recovery Methods

Since we have discussed how this can be achieved with the AD Administrative Center, let us discuss other methods to restore deleted accounts in a windows server using LDP.exe utility and PowerShell cmdlets.

Method 1 – PowerShell ADOptionalFeature cmdlet

In order to demonstrate this with PowerShell, I would love to create an AD user account and then delete it afterward. Here are the steps below, see how to create a contact in AD.

Launch the AD User and Computer. Click on your OU and create the user account as shown below

deleted user accounts

Enter some random names you wish as shown below

Active Directory

Enter the password and decide on what properties you want and then click on Next

Microsoft LDP

Finally click on “Finish” to complete the account creation.

Restore AD Objects

Now, the account creation is complete. We can now proceed with the account deletion once more 🙂

Active Directory

Click on Yes to delete the account as shown below.

Microsoft LDP

Now the account has been deleted as it does no longer appear in the list as shown in the figure below.

PowerShell

Next, run the following PowerShell command to determine the GUID and the DN of the object that was deleted etc.

Get-ADObject -ldapFilter:"(msDS-LastKnownRDN=*)" – IncludeDeletedObjects
Restore AD Objects

Run the command given below in Windows PowerShell to restore the deleted object. As you can see, it makes sense to run the command above in order to determine the account name.

Get-ADObject -Filter 'Name -Like "*lab tester*"' -IncludeDeletedObjects | Restore-ADObject
Active Directory

As you can see, the account has been restored. This command will restore the object back to its previous location in the Active Directory after it is retrieved from the “Deleted objects container”.

Microsoft LDP

You can also use this PowerShell command below

Get-ADObject -Filter {displayName -eq "*lab tester*"} IncludeDeletedObjects | Restore-ADObject

If you wish to restore the object to a different OU, use the command below. You will have to enter each cmdlet as shown below in a single line, even though they may appear word-wrapped across several lines here because of formatting constraints See this link for more information.

Get-ADObject -Filter 'Name -Like "*lab tester*"' -IncludeDeletedObjects | Restore-ADObject -TargetPath "OU=users,DC=techdirectarchive,DC=local"

Method 2 – LDP.exe utility

Ldp is a graphical user interface (GUI)-based tool with a scope pane on the left that is used for navigating through the Active Directory namespace, and a details pane on the right that is used for displaying the results of the LDAP operations.

Moreover, LDP lets you perform connect, bind, search, modify, add or delete operations against AD. LDP is used to view objects stored in AD along with their metadata, and attributes.

Note: ldp.exe is available:
– On computers where the Domain Controller role has been installed.
– On computers where Remote Server Administration Tools (RSAT) has been installed.

To run LDP, perform the following steps
– From the Start menu or “Command Prompt”,
– Type “ldp.exe” and press the “Enter” or “OK” key to start the ldp.exe utility.

Note: You can also call this from the command pormpt, just enter ldp.exe” and click on ok

Microsoft LDP

Select “Connect” from the “Connection menu” to show the “Connect” dialog box.

Restore AD Objects
Screenshot 2020 11 21 at 02.20.20
PowerShell
Screenshot 2020 11 21 at 02.20.34

Enter the server name (server’s IP address or Fully Qualified Domain Name (FQDN)) and default port number as 389.

Click “OK” to establish the connection

deleted user accounts

if the current machine is located inside an Active Directory. Messages like the following will show in the right panel. This indicates that the connection has been established

To complete the connection with the Domain controller server, we will need to verify the existing user credentials.
– Click on the Connection menu again
– Select Bind as show below

Select the first option “Bind as currently logged on user” and
– Click “OK”.

Interface for LDAP bind configuration, showing fields for user, password, and domain with options for bind type and an 'OK' button highlighted.

Click on Controls under the Options menu as shown below

Select “Load Predefined” and click on the Return Deleted objects from drop-down list to access deleted objects.

User interface displaying settings for controls with options for Object Identifier, Value, Control Type, and a list of Active Controls, including a deprecated Policy hints control.

– Click on OK.

User interface displaying control settings with options for object identifier, value selection, control type, and predefined load options including 'Return deleted objects'.

Next, click on Tree” and on the “View” menu to access “Tree”.

Screenshot of an LDAP viewer interface showing the 'View' menu with 'Tree' option highlighted, and an error message displayed on the right side.

Enter the “Distinguished name” as shown below and

CN=Deleted Objects,DC=domain,dc=com
Pop-up window displaying a Tree View with a BaseDN input field showing 'CN=Deleted Objects,DC=techdirectarchive,dc=local' and an 'OK' button highlighted.
Screenshot of an LDAP query interface displaying a directory structure, including error messages and matched distinguished names related to 'Deleted Objects' and 'techdirectarchive.local'.

Right-click the user and click “Modify” command to access the given dialog box

Menu options displayed in a software interface, highlighting the 'Modify' option for managing directory entries in a Windows environment.

In “Edit Entry Attribute” type “IsDeleted” andsSelect “Delete” option and
– Click on “Enter”.

A user interface displaying a Modify window, featuring options to delete an entry with the attribute 'IsDeleted'. The 'Delete' option is highlighted, and an 'Enter' button is shown.
A screenshot of a Modify Entry dialog box used in directory services, displaying fields for DN, attribute, values, operation options (Add, Delete, Replace), and an entry list for the IsDeleted attribute setting.

Next, type the distinguished name in the “Edit Entry Attribute” field as shown below.
– Select “Replace” under “Operation”.
– Also, ensure you select “Extended” checkbox.

Screenshot of a software interface displaying the 'Modify' dialog with options to edit LDAP entries. Key elements include fields for DN, Edit Entry Attribute, Values, and an operation selection with options to Add, Delete, or Replace. Checkboxes for 'Synchronous' and 'Extended' are also visible.

This was the third option I tested because, the object will be restored to the root domain and cannot be restored to its original OU. After recovering the user object, you have to move the object to its parent container manually.

I do not find this feasible, with PowerShell and ADAC, you can restore back to its original OU and even specify a different OU to move it in.

Other tools capable of restoring AD objects:

There are many other tools out there that are capable of performing the same job function.

1: StealthRECOVER: This tool provides point-in-time rollback and recovery of Active Directory objects, attributes, Integrated DNS, and more, allowing organisations to restore objects in their entirety or just the granular attribute information they need.  In a nutshell, it allows you to roll back malicious or unwanted changes with a single click.

2: ADRestore Tool: This is a simple command-line utility that enumerates the deleted objects in a domain and gives you the option of restoring each one. Source code is based on sample code in the Microsoft Platform SDK.

3: Veeam: Veeam provides fast and reliable object‑level recovery for Active Directory from a single‑pass, agentless backup or storage snapshot without the need to restore an entire virtual machine (VM) or use third‑party tools.
– Search and restore for all Active Directory (AD) object types, such as users, groups, computer accounts, and contacts, including user and computer password recovery.

4: Lepide Data Security Platform: Also provides the capability to restore deleted Active Directory objects.

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
Windows Server Tags:Active Directory, Active Directory Domain Services, deletion, PowerShell, PowerShell version 7, Restore

Post navigation

Previous Post: How to setup and configure a Lamp stack on CentOS
Next Post: How to setup PowerShell on a Linux server

Related Posts

  • sign11
    Windows sign-in options and account protection on Windows 11 Windows
  • you need the right to sign in through Remote Desktop Services
    Fix you need the right to sign in through Remote Desktop Services Windows
  • fress install windows server 2025 downgrade of Windows Server datacenter to standard edition
    Convert Windows Server Datacenter to Standard: Install Windows Server via iDRAC Virtual Media Windows Server
  • Screenshot 2021 10 07 at 00.00.32
    How to fix this computer is a domain controller: The snap-in cannot be used on a domain controller Windows Server
  • Server Manager
    How to reinstall Server Manager and disable Server Manager at startup for all users and login users Windows Server
  • Temp Files
    Recover Temp Files using Disk Drill etc on Windows 10 and 11 Windows

More Related Articles

sign11 Windows sign-in options and account protection on Windows 11 Windows
you need the right to sign in through Remote Desktop Services Fix you need the right to sign in through Remote Desktop Services Windows
fress install windows server 2025 downgrade of Windows Server datacenter to standard edition Convert Windows Server Datacenter to Standard: Install Windows Server via iDRAC Virtual Media Windows Server
Screenshot 2021 10 07 at 00.00.32 How to fix this computer is a domain controller: The snap-in cannot be used on a domain controller Windows Server
Server Manager How to reinstall Server Manager and disable Server Manager at startup for all users and login users Windows Server
Temp Files Recover Temp Files using Disk Drill etc on Windows 10 and 11 Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

Veeam Vanguard

  • 785509289 780x439
    How to configure Pleasant Password MsSQL SSO Password Manager
  • AppLocker
    Fix unable to start the Application Identity Service Windows
  • installer file too long fix
    Fix long path names to files on SQL Server installation media error Oracle/MSSQL/MySQL
  • 785509289 780x439
    Errors associated with Pleasant Password Password Manager
  • Featured image 3
    How to add a device to your Microsoft Account Microsoft Exchange/Office/365
  • LAPS PAssword Not Showing Up
    LAPS password not showing up in GUI Windows
  • Plex DS923+ NAS
    Step-by-step guide on how to set up the Synology DS923+ NAS Reviews
  • Lets Encryp
    How to install Let’s Encrypt Certificates with IIS on a Windows Server Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,759 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Contact
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon
  • Bsky

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.