Windows – Pre-Staging Computer Accounts

active-directorybest practiceswindows

I hear that you can create the computer account in AD before you join the computer to the domain so that the computer immediately gets the right groups and such. I created the account by running something like:

New-ADComputer -Name PCXXX -Path "OU=somepath,DC=mydomain.com"

However, when I try to join a new PC to the domain and set the name, the naming parts fails and says the machine account already exists. What am I doing wrong?

Best Answer

Are you saying that you:

  1. prestaged a computer object, COMPUTER1,
  2. joined a workgroup computer named COMPUTER2 to the domain,
  3. attempted to rename this computer to COMPUTER1

If so, the reason it is failing is due to the fact that when you rename a domain-joined computer, it renames the Active Directory object to the new name as well. Since an object with this name already exists (the prestaged object), this will fail. Either change the name of the computer before joining or change the name that you use top prestage.