JSI Tip 3825. How can I add multiple computer accounts to my domain?

If you need to add multiple computer accounts for non-domain controllers to your domain, using a batch file is the easiest method.

The follwing command, run on a domain controller, will add a machine account to your domain:

NET COMPUTER \\computername \[/ADD | /DELETE\]

You could create a batch file that contains multiple NET COMPUTER lines. You could also use the FOR command:

FOR %%i IN (new1 new2 new3) DO NET COMPUTER \\%%i /ADD

NOTE: The command line is limited to 256 characters.

I prefer creating a text file:


The required FOR command would be:

FOR /F "Tokens=*" %%i in (new.txt) do NET COMPUTER \\%%i /ADD

NOTE: Each entry will return a success or failure message.

TAGS: Windows 8
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.