[windows2000] Script now working

  • From: Patrick <london31uk@xxxxxxxxx>
  • To: windows2000@xxxxxxxxxxxxx
  • Date: Wed, 16 Sep 2009 02:21:00 -0700 (PDT)

Hi Guys,

I am a real novice at VBscript, but need to create one that will create users 
from a CSV or Excel file. I found the one below from Microsoft site and 
modified it accordingly, however i an still getting error messages, and it 
would not work.

Please help if anyone can.

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
    ("C:\newuser.xls")
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = ""
    Set objOU = GetObject("LDAP://ou=NewUsers, dc=Jingo, dc=local")
    Set objUser = objOU.Create _
        ("User", "cn=" & objExcel.Cells(intRow, 1).Value)
    objUser.sAMAccountName = objExcel.Cells(intRow, 2).Value
    objUser.GivenName = objExcel.Cells(intRow, 3).Value
    objUser.SN = objExcel.Cells(intRow, 4).Value
    objUser.AccountDisabled = FALSE
    objUser.SetInfo
    intRow = intRow + 1
Loop
objExcel.Quit

See attached error message.


Thanks

Patrick



      

Other related posts:

  • » [windows2000] Script now working - Patrick