【发布时间】:2010-12-09 11:27:48
【问题描述】:
我正在尝试从 xls 文件添加用户列表,但出现此错误:
Line: 6
Char: 5
Invalid Syntax
我尝试使用的脚本如下所示:
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:\Scriptt/Users.xls")
intRow = 3
Do Until objExcel.Cells(intRow,1).Value = ""
Set objOU = GetObject("ou=REAL, dc=ormbunken, dc=com")
Set objUser = objOU.Create _
("User", "cn=" & objExcel.Cells(intRow, 2).Value)
objUser.sAMAccountName = objExcel.Cells(intRow, 1).Value
objUser.SetPassword = objExcel.Cells(intRow, 5).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
有谁知道怎么回事?
【问题讨论】:
-
请阅读我们的常见问题解答,以便您知道要发布到哪个站点。
标签: windows-server-2003 vbscript