Edit existing Windows 2000 server accounts
Top  Previous  Next


[Settings_Begin]
BatchSettings.Delimiter=TAB
BatchSettings.MarkerCol=7  // SetupBatcher uses this column, make sure there's no data in it

SET ADDomainPath=dc=com/dc=acme/dc=D2
SET ADOUName=/ou=Students/ou=6b
SET ADOUPath=%ADDomainPath%%ADOUName%
SET ADAccountPath=%ADOUPath%/cn=%col1%
[Settings_End]

[Machines_Begin]
\\EDU8
[Machines_End]

[Batch_Begin]
Data.Loop   
 AD.Account.SetProperty %ADAccountPath%,UserPrincipalName,%col1%@acme.com   
 AD.Account.SetProperty %ADAccountPath%,LastName,%col2%   
 AD.Account.SetProperty %ADAccountPath%,FirstName,%col3%   
 AD.Account.SetProperty %ADAccountPath%,Initials,%col4%   
 AD.Account.SetProperty %ADAccountPath%,StreetAddress,%col5%   
 AD.Account.SetProperty %ADAccountPath%,TelephoneNumber,%col6%
Data.Endloop   
[Batch_End]

[Data_Begin]
stevej   Jones   Steve   SJ   220 Camden High Street   221 123 123 432   
marthas   Smith   Martha   MS   34 Riverside drive   029 192 494   
[Data_End]


About the script

·Domain name = "D2.acme.com" -> [Settings]:"SET ADDomainPath=dc=com/dc=acme/dc=D2".  
·Server name = "\\EDU8" -> listed in the [Machines] section.  
·The accounts to be modified are in the "6b" container in the "students" container -> [Settings]:"SET ADOUName=/ou=Students/ou=6b"  
·CN user names are listed in [Data] column 1 -> [Settings]:"ADAccountPath=%ADOUPath%/cn=%col1%".  
·The "AD.Account.SetProperty" commands in the [Batch] section sets UserPrincipalName to CN user name + "@acme.com", reads LastName from [Data] column 2, FirstName from [Data] column 3, etc. For more properties, please see AD.Account.SetProperty.