****Second Post**** No replys on other post.... :-(
I am a newbie to using kix to control Active directory functions. I have been looking at the scripts others have created and taking pieces to play with them to better understand how to make things work. I have know hit a wall and need some more direct help. I have created (via other scripts) this script to add a user to the OU in AD. I am having the following problems:
1) Account shows as disabled
2) Can not add Login Script, password, Street information, exchange account and some other fields. (it would be great if someone could explain how I could find the information for all the fields)

Any help will be great!

;Sets up User ID and Name in Test OU

 Code:
CreateAccount("123456","Lastname Test", "LDAP://OU=test,OU=ouinformation,OU=nextleaveOU, dc=Domain ,dc=ad")
Function CreateAccount($UserName, $FullName, $ADsPath)
$OU = GetObject($ADsPath)
$UserObj = $OU.Create("User","cn=$FullName")
$UserObj.Put ("sAMAccountName", $UserName)
$UserObj.Put ("givenName", "John") ;First Name
$UserObj.Put ("Initials", "Frank") ;Initials
$UserObj.Put ("sn", "Smith") ;Last Name(Surname)
$UserObj.Put("displayName","Smith" + IIf("smith", ", ","") +
"John" + IIf("Frank", " ", "") +
"Frank") ;Display name
$UserObj.Put ("description", "Head Man in charge") ;Description
$UserObj.Put ("physicalDeliveryOfficeName","Wahington, DC") ;Office
$UserObj.Put ("telephoneNumber","222-555-5555");Telephone
$UserObj.Put ("mail","first_Last@company.com") ;E-mail
$UserObj.Put ("wWWHomePage","www.kixtart.org") ;Web page
$UserObj.Put ("userPrincipalName", "123456") ;userPrincipalName
$UserObj.Put ("LoginScript", "common.bat") ;Logon Script
$UserObj.Put ("Street", "1234 A Street, NW") ;Street
$UserObj.Put ("Password", "gensler")
$UserObj.Put ("AccountDisabled", "False") 
$UserObj.Put ("LoginScript", "gensler_dc\common.bat")
$UserObj.SetInfo
; Objects cleanup
$UserObj = 0
$OU = 0
EndFunction


Edited by rossw (2008-01-17 12:02 AM)