Restore-ADObject -identity (Get-ADObject -SearchBase (get-addomain).DeletedObjectsContainer -IncludeDeletedObjects -filter "sAMAccountName -eq 'OneOfDeletedNames'").distinguishedName
of course OneOfDeletedNames should has dollar sign ($) at the end when deleted object is a computer account.
or for multiple objects
("comp1", "user1345", "jOhnSmith12") | %{ Restore-ADObject -identity (Get-ADObject -SearchBase (get-addomain).DeletedObjectsContainer -IncludeDeletedObjects -filter "sAMAccountName -eq '$_'").distinguishedName}
Brak komentarzy:
Prześlij komentarz