星期二, 九月 11, 2007

Quick Way To Create Hundreds of User Accounts in AD



 
 

Sent to you by Hudong via Google Reader:

 
 

via MSDN Blogs by rodgerjt on 9/11/07

I just had to create a few hundred user accounts in a test AD environment and the easiest way I new of is to use the DSADD USER cmd line tool. DSADD ships with Windows Server 2003 under the C:\Windows\System32 directory.

In these examples, I'm creating accounts with the username format of user001, user002, ... user099, user100, etc

FOR /L %i IN (1,1,9) DO dsadd user "CN=user00%i,CN=Users,DC=tailspintoys,DC=com" -display user%i -pwd pass@word1 -canchpwd no -pwdneverexpires yes

FOR /L %i IN (10,1,99) DO dsadd user "CN=user0%i,CN=Users,DC=tailspintoys,DC=com" -display user%i -pwd pass@word1 -canchpwd no -pwdneverexpires yes

FOR /L %i IN (100,1,999) DO dsadd user "CN=user%i,CN=Users,DC=tailspintoys,DC=com" -display user%i -pwd pass@word1 -canchpwd no -pwdneverexpires yes


 
 

Things you can do from here:

 
 

没有评论:

发表评论