Create and delete 100 Internet-enabled accounts in five minutes
Top  Previous  Next


The below script can be executed

·by clicking "Run batch" (CTRL+R)  
·by calling SetupBatcher from the command line - from your own program  
·from SetupExplorer [click new] - when you need to add single accounts on a daily basis  

Required

·NT4 or Windows 2000 server  
·Exchange 5.5 server  
·IIS 4.0  
·IIS.VirtualDir commands requires ADSI 2.5.  
·The exchange.55.Mailbox commands requires acctcrt.dll and ADSI 2.5. When Exchange.55.Mailbox commands are used on a Windows 2000 server, a port number must be specified, see command reference.  

(a) Copy the below script (CTRL+C, CTRL+V to paste in SetupBatcher)

[Settings_Begin]
BatchSettings.Delimiter=TAB
Account.FullName.Col=1
SET username=%col4%    // %username% instead of %col4% below = easier to change column
Account.Password.col=5
Account.Description.Col=6
BatchSettings.MarkerCol=7
Account.Password.MustChange=No
Account.Expires=Never
SET HomeRoot=d:\users
SET ExchContPath=o=y/ou=D30/cn=Recipients
SET NTdomain=D30
SET EmailSuffix=acme.com
[Settings_End]

[Machines_Begin]
\\EDU2830      NT PDC    
[Machines_End]

[Batch_Begin]
Data.Loop          
Account.Create %username%          
Exchange.55.Mailbox.Create %servername2%,%ExchContPath%,%NTdomain%,%username%,%col1%,@%EmailSuffix%
DOS md %HomeRoot%\%username%       
DOS md %HomeRoot%\%username%\WWW           
DOS echo %col1% - nothing here yet...>%HomeRoot%\%username%\WWW\default.htm        
IIS.VirtualDir.Create Web,%servername2%,1,%username%,%HomeRoot%\%username%\WWW     
IIS.VirtualDir.SetProperty Web,%servername2%,1,%username%,DontLog,True     
Data.Endloop       
[Batch_End]

[Undo_Batch_Begin]
Data.Loop          
Exchange.55.Mailbox.Delete %servername2%,%ExchContPath%,%username%    
IIS.VirtualDir.Delete Web,%servername2%,1,%username%       
DOS echo y| rd %HomeRoot%\%username%\www /s        
DOS echo y| rd %HomeRoot%\%username%\ /s           
Account.Delete %username%          
Data.Endloop       
[Undo_Batch_End]

[Data_Begin]
Deborah Chiel         dc   jidij+w3ee      
Martin Gardner         mg   d23jioE      
William Karush         wk   dko3aaX      
[Data_End]

(b) Edit the script

Description of the batch section

·Create account  
·Create Exchange 5.5 mailbox  
·Create home directory  
·Create www directory in home directory  
·Create default web page  
·Create IIS 4.0 web share  

Description of the undo section

·Delete Exchange 5.5 mailbox  
·Delete IIS 4.0 web share  
·Delete web subdirectory (this and only this subdirectory requires a separate command)  
·Delete home directory (and all files and directories in it)  
·Delete account  

What to modify

·[Settings]: Home directory root (choose a NTFS volume) - example "d:\users" - "SET HomeRoot=d:\users"  
·[Settings]: ExchContPath - Path to Exchange target container. example: Exchange organization="y", Site="D30", container="recipients" - "SET ExchContPath=o=y/ou=D30/cn=Recipients"  
·[Settings]: NTdomain - example "d30" - "SET NTdomain=D30"  
·[Settings]: E-mail suffix - example "@acme.com" - "SET EmailSuffix=acme.com"  
·[Machines] : Change server name  

See also: Create web pages by using the copy command.

(c) Create accounts

·Enter full names, account names and passwords in the [Data] section It is of course also possible to import data from an external source, see Importing data to the [Data] section.  
·Click "Run Batch" to start the batch job.  

(d) Test the accounts

·Start "User Manager for domains" and make sure that the accounts are set up correctly  
·Start "Microsoft Exchange Administrator" and make sure that the mailboxes are listed under "Recipients"  
·Start your E-mail client and try to send and receive mail with one of the E-mail accounts  
·Start "Internet Service Manager" and make sure that the virtual directories are listed under "Default Web Site"  
·Start your web browser and try one of the web directories  



(e) Delete accounts

·Click "Undo Batch" to run the [Undo] section