AD.Account.Create
Top  Previous  Next


Creates global user account

Requires Windows 2000 or 2003 (or Windows NT 4.0 SP6a or later with DSClient).

Category
Active Directory

Script section
[Batch], inside Data.Loop..EndLoop statement

AD.Account.Create
ContainerPath, CN, SamAccountName, Password

ContainerPath
Full AD path to container in which to create account  

CN
Common name of account to create  

SamAccountName
SamAccountName of account to create, maximum length is 20 characters  
 
The cryptic error message "A device attached to the system is not functioning (#30)" means that there are too many characters in the SamAccountName.  
 
Most examples sets CN and SamAccountName to the same value -> both must be <= 20 characters.  

Password
Password of account to create  

Other parameters
New account default values (use AD.Account.SetProperty to change)  
·Account disabled = Yes  
·Account never expires = Yes  
·Group = Domain user  
·Password never expires = No  
·User cannot change password = No  
·User must change password = Yes  
·All other properties empty  

Tip
Use the SetupBatcher script wizard to get started with the syntax.

Example

Create account in the myOU OU of domain d2.acme.com, read properties from [data] section - CN and SamAccountName from column 2 and password from column 7

AD.Account.Create dc=com/dc=acme/dc=d2/ou=myOU,%col2%,%col2%,%col7%

Full example
Basic user and group management with AD commands