AD Troubleshooting

AD and Domain-related issues and troubleshooting methods for Active Directory.

How to bulk create 10000 users and groups for your test environment

A Technet Blog

AD Troubleshooting

How to bulk create 10000 users and groups for your test environment

Rate This
  • Comments 3

For test lab scenarios where you quickly want to add a few thousand users you can run the following batch files in a DC:

:Creates 10000 disabled user accounts with password Password1
For /l %%t IN (1,1,10000) do net user BulkUser%%t Password1 /add /PASSWORDREQ:YES /ACTIVE:NO

:Bulk create 1000 groups
For /l %%t IN (1,1,1000) do net group Bulkgroup%%t /add /domain

 

Comments
  • I received the following error when running the first command:  

    "%%t was unexpected at this time."

  • It sounds like you only copied the first line of the command - the second part is required also ("Password1 /add /PASSWORDREQ:YES /ACTIVE:NO")

  • Instead of %%t, use %t

Page 1 of 1 (3 items)
Leave a Comment
  • Please add 6 and 4 and type the answer here:
  • Post