Active Directory Reset password - able to login with both old password and new password [modified]
-
I working with Active Directory Reset password.
DirectoryEntry DirEntry = GetDirectoryEntry();
DirEntry.UsePropertyCache = false;
DirEntry.Invoke("SetPassword", new object[] { newpassword });
DirEntry.CommitChanges();The code is working fine but after changing the password I am able to login with both old password and new password. I found with my observation that after one hour approximately the old password expires. Is there any way to expire the old password immediately when I change the password?
Sudhir Mangla http://tips.DevelopersVoice.com (Technical Tips and Tricks) http://Programmerworld.net (Free books and source code) http://Faq.Programmerworld.net (FAQ and Tips for programmers)
modified on Thursday, November 13, 2008 6:39 AM
-
I working with Active Directory Reset password.
DirectoryEntry DirEntry = GetDirectoryEntry();
DirEntry.UsePropertyCache = false;
DirEntry.Invoke("SetPassword", new object[] { newpassword });
DirEntry.CommitChanges();The code is working fine but after changing the password I am able to login with both old password and new password. I found with my observation that after one hour approximately the old password expires. Is there any way to expire the old password immediately when I change the password?
Sudhir Mangla http://tips.DevelopersVoice.com (Technical Tips and Tricks) http://Programmerworld.net (Free books and source code) http://Faq.Programmerworld.net (FAQ and Tips for programmers)
modified on Thursday, November 13, 2008 6:39 AM
Hint: How many domain controllers are on your network and how often to they sync up?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Hint: How many domain controllers are on your network and how often to they sync up?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Currently I am using a test domain setup on a test machine. So there is only one Domain Control.
Sudhir Mangla http://tips.DevelopersVoice.com (Technical Tips and Tricks) http://Programmerworld.net (Free books and source code) http://Faq.Programmerworld.net (FAQ and Tips for programmers)
http://health.Programmerworld.net (Health tips) -
I working with Active Directory Reset password.
DirectoryEntry DirEntry = GetDirectoryEntry();
DirEntry.UsePropertyCache = false;
DirEntry.Invoke("SetPassword", new object[] { newpassword });
DirEntry.CommitChanges();The code is working fine but after changing the password I am able to login with both old password and new password. I found with my observation that after one hour approximately the old password expires. Is there any way to expire the old password immediately when I change the password?
Sudhir Mangla http://tips.DevelopersVoice.com (Technical Tips and Tricks) http://Programmerworld.net (Free books and source code) http://Faq.Programmerworld.net (FAQ and Tips for programmers)
modified on Thursday, November 13, 2008 6:39 AM
Assume you perform login authentication with code below :
bool loginResult = false;
using (DirectoryEntry de = new DirectoryEntry(this.SearchRoot.Path, userDN, password, AuthenticationTypes.Secure))
{
try
{
object x = de.NativeObject;
loginResult = true;
}
catch (COMException comEx)
{
}
return loginResult}
Just Change the AuthenticationTypes to AuthenticationTypes.Secure will solve the problem. If the AuthenticationTypes is AuthenticationTypes.None then it will able to login with old password. refer this :Windows Server 2003 Service Pack 1 modifies NTLM network authentication behavior