We have several computer labs, each with about 25 computers. We sometimes need to re-image the computers. The computers automatically add themselves to the domain using PowerShell.
The problem is that the computer object already exists in Active Directory if the computer has already been imaged. We ask our domain administrator to delete the computer objects before imaging, but that is annoying for him and for us.
Here are my questions:
- Currently, we have a domain user account that has the ability to add computers to the domain. Is there a permission that could be added to also allow the user account to delete computer objects?
- If the answer to the above question is "yes," then can PowerShell use that domain user account to delete the computer account? Is there something like a "Delete-ComputerObject" cmdlet?
Ideally, we would like this:
1....