Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Active Directory Reset password - able to login with both old password and new password [modified]

Active Directory Reset password - able to login with both old password and new password [modified]

Scheduled Pinned Locked Moved C#
csharpcomwindows-adminquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sudhir Mangla
    wrote on last edited by
    #1

    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

    D K 2 Replies Last reply
    0
    • S Sudhir Mangla

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        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

        S Offline
        S Offline
        Sudhir Mangla
        wrote on last edited by
        #3

        Currently 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)

        1 Reply Last reply
        0
        • S Sudhir Mangla

          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

          K Offline
          K Offline
          kakarato
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups