Solved

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

Posted on 2014-12-09
1
510 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 28

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

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

696 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