473,320 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Changing domain password

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
Sep 23 '05 #1
1 4253
Mindy Geac wrote:
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
Sep 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Daniel | last post by:
If i log into my computer as domain A and user X and password Y but then I need to give C# application access to domain B as user F and password G. Is this possible? or do i have to log into the...
1
by: BP | last post by:
Can anyone point me to some C# code/info that would allow me to change the Administrator password on a remote machine in a workgroup? Not a domain, no Active Directory present. I realize I need...
1
by: missoula | last post by:
Hello- I can connect to my own domain fine with the following: entry = new DirectoryEntry("LDAP://RootDSE"); However, I am trying to get information out of AD for another domain. This...
0
by: M Greevy | last post by:
Hello, I was wondering if you could help me or tell me this is not possible. I have a client that wants the ability to change a local server password from an ASP page for a non-domain windows 2003...
2
by: - Steve - | last post by:
I'm trying to change a user's password using objUser.Invoke("setPassword", "newpassword") It works fine as a console application if I'm logged in with someone with the correct permissions. If...
1
by: VB Programmer | last post by:
Using ASP.NET 2.0 Web Site Admin Tool. Under Security tab it says this: Click a row to select a user and then click Edit user to view or change the user's password or other properties. When...
2
by: J | last post by:
Hello. I apologize if this isn't the appropriate group for this question but I was wondering if it's possible to allow regular windows domain users to change their passwords through an .asp page? ...
10
by: Sridhar | last post by:
HI, I am having problems setting up a website so that it will be available only inside the domain. We have three servers. One is iis server and second one is internal server and the third one is...
2
by: JOHNSHELL08 | last post by:
Dear Team, There is a problem related to change ip address there in my network a domain admin user is exist and user knows its password and by this they are able to login with this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.