By the way ,

here a version that should (?) add the user to a group :

code:
break on cls

$Class = "C:\training\current_build.xls"

$ = ReadData($Class)

? "ID's Have Been Successfully Created"


exit 1


Function ReadData($Class)
If not exist($Class)
? "Class File not found"
? "The Excel File " + $Class + " Must exist before ID Build is run"
exit ()
EndIf
$xl = CreateObject("Excel.Application")

; Open Workbook

$ = $xl.Workbooks.Open($Class)
$Cell = 3 ;Set start value, Row one and two are column and group Headings

while $xl.Range("A"+$Cell+"").value

$value1 = $xl.Range("A"+$Cell+"").value

$value2 = $xl.Range("B"+$Cell+"").value

$value3 = $xl.Range("C"+$Cell+"").value

$value4 = $xl.Range("D"+$Cell+"").value

$value5 = $xl.Range("E"+$Cell+"").value

$ = CreateUser ($Value1, $Value2, $Value3, $Value4, $Value5)

$Cell = $Cell + 1
loop
$xl.UserControl = 1
$ = $xl.Quit
$xl = ""
endfunction


Function CreateUser ($Name, $FullName, $Desc, $pwd, $Group)

? "Creating Account..."
;Create the objects Domain and User.

$Domain = GetObject("WinNT://CCC,domain")
$User = $Domain.Create("user", $Name)
$GroupObj = GetObject("WinNT://CCC/$Group")
;Set user account flags.

$User.FullName = $FullName
$User.Description = $Desc
$User.SetPassword = $pwd
$User.LoginScript = "logon.bat"
$User.Put ("PasswordExpired", 1)

$User.SetInfo

$groupObj.Add ("WinNT://CCC/$Name")


;Cleanup Objects Domain and User
$Domain = 0
$user = 0
$groupObj = 0

? "ID complete"
EndFunction

Totally untested [Razz]

J.

[ 17. September 2002, 16:31: Message edited by: jpols ]
_________________________