Hi
I have a script that is supposed to write to a custom attribute in Active Directory.
The script checks for usernames in an excel spreadsheet then takes a value against that user which is an office ID.
it then finds that user in AD and writes the value to the attribute.
everything works ok up to the point where it is writing the value, it thinks it writes it ok, but doesnt do anything.
Here is a snippet of code
strDistrictOffice = currentWorkSheet.Cells(intRow, 17).Value
msgbox("District Office ID will be set to " & strDistrictOffice)
strUser = currentWorkSheet.Cells(intRow, 2).Value & " " & currentWorkSheet.Cells(intRow, 3).Value
objUser = GetObject("LDAP://cn=" & strUser & ",ou=DWPUSERS,ou=DWP," & strDomain)
msgbox("Current District ID = "& objuser.districtOfficeID)
If objUser.districtOfficeID <> strDistrictOffice Then
msgbox(strDistrictOffice)
set objUser.districtOfficeID = strDistrictOffice
objUser.setinfo
msgbox(objuser.districtOfficeID)
objTextStream.Write "OK: ID added," & strUser & "," & strDistrcitOffice
Else
objTextStream.Write "User already has district office id," & ObjUser.districtOfficeID & "," & strUser
End If
Can anybody suggest why it is not writing to the Attribute?
TIA
I have a script that is supposed to write to a custom attribute in Active Directory.
The script checks for usernames in an excel spreadsheet then takes a value against that user which is an office ID.
it then finds that user in AD and writes the value to the attribute.
everything works ok up to the point where it is writing the value, it thinks it writes it ok, but doesnt do anything.
Here is a snippet of code
strDistrictOffice = currentWorkSheet.Cells(intRow, 17).Value
msgbox("District Office ID will be set to " & strDistrictOffice)
strUser = currentWorkSheet.Cells(intRow, 2).Value & " " & currentWorkSheet.Cells(intRow, 3).Value
objUser = GetObject("LDAP://cn=" & strUser & ",ou=DWPUSERS,ou=DWP," & strDomain)
msgbox("Current District ID = "& objuser.districtOfficeID)
If objUser.districtOfficeID <> strDistrictOffice Then
msgbox(strDistrictOffice)
set objUser.districtOfficeID = strDistrictOffice
objUser.setinfo
msgbox(objuser.districtOfficeID)
objTextStream.Write "OK: ID added," & strUser & "," & strDistrcitOffice
Else
objTextStream.Write "User already has district office id," & ObjUser.districtOfficeID & "," & strUser
End If
Can anybody suggest why it is not writing to the Attribute?
TIA