Changing domain password

M

Mindy Geac

Hello,

I'm seaching for the possibility to change Domain/User passwords. And a
check for users if the password has to change with the first logon or when
the password is expired.

thanx,

Mindy
 
G

Gottfried Mayer

Mindy said:
Hello,

I'm seaching for the possibility to change Domain/User passwords. And a
check for users if the password has to change with the first logon or when
the password is expired.

thanx,

Mindy
Hi Mindy Geac,

The ADSI User Object has a Function "ChangePassword" where you can
change a user's Password. The Function takes the current and new
password as a parameter:

It's easiest to enable Basic authentication on the .ASP - File, then you
can get the current Password with:
strOldPass = Request.ServerVariables("AUTH_PASSWORD")
WARNING!!! with Basic Authentication THE USER'S PASSWORD IS SENDT
PLAINTEXT ON EVERY PAGE REQUEST!!!
I would do this only with enabled SSL!!


EXAMPLE CODE (VBScript):

Dim oUser, strOldPass, strNewPass
strOldPass = "password"
strNewPass = "newpass"
Set oUser = GetObject("WinNT://DOMAIN/USERNAME,user")
oUser.GetInfo
On Error Resume Next
oUser.ChangePassword strOldPass, strNewPass
If err <> 0 Then
Response.Write "ERROR: " & Err.Number & " - " & Err.Description
Else
Response.Write "Password changed."
End If
Set oUser = Nothing

EXAMPLE CODE END

The most common Error I got while changing passwords was the
Password-Complexity or Password-Age set in Windows2003 Server:
AFAIK Complexity has to include uppercase/lowercase/numbers and the
Password-Age has to be at least 1 day (you cannot change twice on same
day) by default...

As for the "Change on first Logon" - I'm sure someone else here can
answer this with ease.


HTH
Gottfried
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top