Solved

Active Directory restoration of deleted computer account with Restore-ADobject cmdlet

Posted on 2014-12-09
1
352 Views
Last Modified: 2014-12-11
Someone at some point deleted one of our servers from active directory which i just noticed today. I have ran the powershell to search the deleted items container and found the object there. We do not have the recyling bin enabled so I will need to use the powershell to do this.

The command I am running to find the computer object is as follows.

get-adobject -filter 'isDeleted -eq $true' -IncludeDeletedObjects | where-object {$_.name -like "servername*" -and $_.objectclass -eq "computer"}

This returns a single object of the computer account.

Now to restore it I can simply pipe to restore-Adobject

get-adobject -filter 'isDeleted -eq $true' -IncludeDeletedObjects | where-object {$_.name -like "boslitfs02*" -and $_.objectclass -eq "computer"}  | restore-adobject

Is there anything else needed or any issues I may run into? I usually would just disjoin/rejoin domain for this type of issue but this server is taking part in a DFS namespace.

Any help is appreacited.
0
Comment
Question by:Joseph Daly
1 Comment
 
LVL 26

Accepted Solution

by:
Dan McFadden earned 500 total points
ID: 40491011
The command looks good, though I would use the name without the asterisk to be on the safe side.

Dan
0

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SolarWind and DNS Server 12 39
shadow copies 7 16
Restore DNS Record 5 46
Monitor vmware windows vm status of services 9 15
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now