We have a serious problem to set the LDAP attribute 'userPassword' in
eDirectory within an ASP file running IIS. The problem is related to
the NWIDirEntriesLib component. If we run the ASP file, then we got
this error message: "insufficient access".
BTW: there is always a connection to LDAP server using an admin
account, so that can not be the problem.
How can we handle this attribute 'userPassword'?
The vbscript code in ASP:
function setUserPasswordViaLDAP(i_strCN, i_strOldPassword,
i_strNewPassword)
'on error resume next
' instantiate component
dim objDirEntries
set objDirEntries =
Server.CreateObject("NWIDirEntriesLib.NWIDirEntries.1.1")
' connect to LDAP
objDirEntries.PortNumber = LP_LDAP_SERVER_PORT
objDirEntries.FullName = LP_LDAP_SERVER & "/" &
LP_LDAP_SERVER_O_CORP
objDirEntries.UserName = LP_LDAP_SERVER & "/" &
LP_LDAP_SERVER_O_CORP & "/" & LP_LDAP_SERVER_OU_USERS &
LP_LDAP_ADMIN_CN
objDirEntries.Password = getDecodedAdminPasswordFromRegistry()
objDirEntries.Connect
' ...till here ok, with admin rights...
' set organizational unit
objDirEntries.FullName = LP_LDAP_SERVER & "/" &
LP_LDAP_SERVER_O_CORP & "/" & LP_LDAP_SERVER_OU_USERS
dim strUser
strUser = "cn=" & i_strCN
' get organizational unit for user
dim objEntry
set objEntry = objDirEntries.Entries.Item(strUser) ' voorbeeld:
"CN=user1"
dim phNos
dim phArray(0)
phArray(0) = i_strNewPassword
phNos = phArray
call objEntry.SetFieldValue("userPassword", phNos)
objEntry.Update
' We use the admin account, but objEntry.Update causes "insufficient
access" error ?!?!
if Err.Number = 0 then
setUserPasswordViaLDAP = ""
else
setUserPasswordViaLDAP = cstr(Err.number)
end if
end function
How can we handle this attribute 'userPassword'? We have alreay tried
function setPassword, but that function doesn't work too. Function
setPassword() obsolete?
Regards,
Coen Mooijman
Marcel
cmoo...@aepex.com (Coen) wrote in message news:<e9ffb5a1.03030...@posting.google.com>...