Password change using ADSI- weird problem

Password change using ADSI- weird problem

Post by Gavin Bal » Fri, 27 Oct 2000 12:45:45



I am using ADSI to allow users to change  WinNT4 via a web browser. The
webpage used NTLM authentication

The problem is this...

If i log on as myself (administrator), the script executes and the users
password is updated.

If i log on as a user, i get an error message 80070005 (access is denied)
however...the password is updated anyway !!.

If the user does not have access to change the password, why does the
password change anyway ? if they do have permission, why do i get an error
being generated ?

Script is as below

oldpass = request.form("oldpass")
newpass = request.form("newpass")
username = request.form("username")

On Error resume next
Set UserObj = GetObject("WinNT://domain/computer/" & username & ",user")
UserObj.ChangePassword oldpass, newpass
UserObj.SetInfo
If err then
 If hex(err) = 80070056 then
          Response.write "Password not changed, Old password is incorrect"
 elseif hex(err) = 80070005 then
          Response.write "Password changed , Access is denied"
 else Response.write
          Response.write "Password Change Was Not Successful" & "Error:" &
hex(err)
 end if
Else
         response.write "Pasword successfully changed"
End If
Set UserObj = Nothing

I

 
 
 

1. Using ADSI to set "User must change password at next logon"

Hi,

I'm writing a script to force all user accounts in our domain to change
their password at the next logon.  However this attribute doesn't seem to
exist in the list of user flags I've seen in the ADS_USER_FLAG_ENUM
documentation on Microsoft's MSDN site.  I thought that I might be able to
use UF_NORMAL_ACCOUNT but that doesn't seem to work.  Does anyone know how I
might be able to set that flag?  Thanks for any help offered.

Sincerely,

David Shriner

2. FreeDSL and RoadRunner on Same network.

3. Error changing password using ASP & ADSI

4. How to create a variable Hyperlink Address?

5. Problem while changing password in ADSI

6. Radio Modem For WAN and Serial Port Communication

7. Changing a user password who has 'Change Password at next Logon' flagged

8. Multiple devices on an IP address ?

9. Password change / Password file problem.

10. Weird password problem ?!?!?

11. Weird problem with multiple samba servers and NT4 passwords

12. ASP/ADSI Page to Change passwords

13. ADSI - WINNT change password