Searching for and restoring deleted AD user objects using PowerShell

The command to search for the deleted object. Use this command via PowerShell logged into a DC, or from a PowerShell window that has the AD cmdlets imported.

Get-ADObject -Filter 'samaccountname -eq ""' -IncludeDeletedObjects

This will return a value for the user if it finds a deleted user that matches this search criteria. If it does, and it is the user you wish to restore, pipe the output to Restore-ADObject to restore it like so:

Get-ADObject -Filter 'samaccountname -eq ""' -IncludeDeletedObjects | Restore-ADObject