Active Directory and ChangePassword

Results 1 to 2 of 2

Thread: Active Directory and ChangePassword

  1. #1
    Join Date
    Dec 1969

    Default Active Directory and ChangePassword

    I have written a code where users in an Active Directory should be able to change their logon password from within a webpage. The code follows:<BR><BR>Set con = CreateObject("ADODB.Connection")<BR>Set com = CreateObject("ADODB.Command")<BR>con.Provider = "ADsDSOObject"<BR>con.Open "Active Directory Provider"<BR>Set Com.ActiveConnection = con<BR><BR> Dim sPhone, sUsr, rs, sDn<BR> sDn = Request("tDn")<BR> sUsr = Request("tCn")<BR> sPw = Request("tPassword") & ", " & Request("tPassword2")<BR> str = "LDAP://" & sDn<BR> <BR> Set usr = GetObject(str)<BR> usr.ChangePassword sPw<BR> usr.Append <BR>Response.Write "Password Changed"<BR><BR>Can anyone tell me why I get the error<BR>&#062;Microsoft VBScript runtime (0x800A01C2)<BR>&#062;Wrong number of arguments or invalid property &#062;asignment: &#039;ChangePassword&#039;<BR><BR>Have a nice day.<BR>Roy M. Halvorsen.

  2. #2
    Join Date
    Dec 1969

    Default RE: Active Directory and ChangePassword

    I think you need to provide both the original password and the new one to ChangePassword:<BR><BR>sOldPw = Request("tOldPw")<BR>...<BR>usr.ChangePassword sOldPw,sPw<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts