Hi
I have an excel file containing User information from my windows 2000 domain.
File is in the format of column A contains common name eg. Bloggs Joe
Column E contains OU name and
Column F contains Group name.
I have other info in other columns like first name last name, SAM Account name etc.
Using the script below I get an error number but no description error number is 2147463168
What am I doing wrong?
Thanks in advance for any help.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("D:\newusers.xls")
On Error Resume Next
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = ""
strGroup = "cn=" & objExcel.Cells(intRow, 6).Value & ",ou=groups,dc=testing,dc=com"
strMember = "cn=" & objExcel.Cells(intRow, 1).Value & "ou=" & objExcel.Cells(intRow, 5).Value & ",dc=testing,dc=com"
Set objGroup = GetObject("LDAP://" & strGroup)
Err.Clear
objGroup.Add("LDAP://" & strMember)
If Err.Number <> 0 Then
Wscript.Echo Err.Number & "--" & Err.Description
Err.Clear
End If
objGroup.SetInfo
intRow = intRow + 1
Loop
I have an excel file containing User information from my windows 2000 domain.
File is in the format of column A contains common name eg. Bloggs Joe
Column E contains OU name and
Column F contains Group name.
I have other info in other columns like first name last name, SAM Account name etc.
Using the script below I get an error number but no description error number is 2147463168
What am I doing wrong?
Thanks in advance for any help.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("D:\newusers.xls")
On Error Resume Next
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = ""
strGroup = "cn=" & objExcel.Cells(intRow, 6).Value & ",ou=groups,dc=testing,dc=com"
strMember = "cn=" & objExcel.Cells(intRow, 1).Value & "ou=" & objExcel.Cells(intRow, 5).Value & ",dc=testing,dc=com"
Set objGroup = GetObject("LDAP://" & strGroup)
Err.Clear
objGroup.Add("LDAP://" & strMember)
If Err.Number <> 0 Then
Wscript.Echo Err.Number & "--" & Err.Description
Err.Clear
End If
objGroup.SetInfo
intRow = intRow + 1
Loop