I am trying to modify users' AD information using an Excel Spreadsheet. Here is my script:
Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = False
'intRow = 2
strFile = "C:\script\test_emp_info.xls"
strDomain = "OU=PSTEST,DC=russellreynolds,DC=com"
Set objWorkbook = objExcel.Workbooks.Open(strFile)
Do Until objExcel.Cells(intRow,1).Value = ""
Set objUser = GetObject("CN=" & objExcel.Cells(intRow,3 & intRow,2).Value "," & strDomain)
objUser.physicalDeliveryOfficeName = objExcel.Cells(intRow,6).Value
objUser.title = objExcel.Cells(intRow,8).Value
objUser.SetInfo
intRow = intRow + 1
Loop
objExcel.Quit
But I get the following error:
Line: 40
Char: 77
Error: Expected ')'
Code: 800A03EE
Any help asap would be greatly appreciated.
Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = False
'intRow = 2
strFile = "C:\script\test_emp_info.xls"
strDomain = "OU=PSTEST,DC=russellreynolds,DC=com"
Set objWorkbook = objExcel.Workbooks.Open(strFile)
Do Until objExcel.Cells(intRow,1).Value = ""
Set objUser = GetObject("CN=" & objExcel.Cells(intRow,3 & intRow,2).Value "," & strDomain)
objUser.physicalDeliveryOfficeName = objExcel.Cells(intRow,6).Value
objUser.title = objExcel.Cells(intRow,8).Value
objUser.SetInfo
intRow = intRow + 1
Loop
objExcel.Quit
But I get the following error:
Line: 40
Char: 77
Error: Expected ')'
Code: 800A03EE
Any help asap would be greatly appreciated.