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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Active Directory - Reset password

Active Directory - Reset password

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netwindows-adminquestion
3 Posts 2 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.
  • B Offline
    B Offline
    bud80
    wrote on last edited by
    #1

    I made an application with asp.net 2.0 (c#) to manage users in active directory. I need to reset the user's password and at the first access The system have to ask me to change the password. Any Idea?

    T 1 Reply Last reply
    0
    • B bud80

      I made an application with asp.net 2.0 (c#) to manage users in active directory. I need to reset the user's password and at the first access The system have to ask me to change the password. Any Idea?

      T Offline
      T Offline
      Tzumer Edo
      wrote on last edited by
      #2

      Well dude, its not clear what you're asking, I mean - is the question how to create a unique password ? in that case you can use the create a unique ID using the .NET's GUID or the logic of how to know if he is entering on the first time... in that case you can use a boolean flag in the database, say "IsFirstTimer" that is set to True at first and then set to False or did you have a different question :confused:

      Regards, Tzumer Edo.

      B 1 Reply Last reply
      0
      • T Tzumer Edo

        Well dude, its not clear what you're asking, I mean - is the question how to create a unique password ? in that case you can use the create a unique ID using the .NET's GUID or the logic of how to know if he is entering on the first time... in that case you can use a boolean flag in the database, say "IsFirstTimer" that is set to True at first and then set to False or did you have a different question :confused:

        Regards, Tzumer Edo.

        B Offline
        B Offline
        bud80
        wrote on last edited by
        #3

        I try to explain better.. With my application i can create user and store it to active directory. I set for the user a default password. With this credentials user can login into Windows: if it's the first access, Windows ask to change the password. If a user losts the password, my application allow to reset it, and set a new default password. Now when the user login into Windows, the system have to re-ask to change the password... How can I do this? The code to reset the password is below DirectoryEntry uEntry = GetDirectoryEntry(Path); uEntry.Invoke("SetPassword", new object[] { "NewPassword"}); uEntry.Properties["LockOutTime"].Value = 0; //unlock account int flags = (int)uEntry.Properties["userAccountControl"][0]; uEntry.Properties["pwdLastSet"].Value = -1; uEntry.CommitChanges(); uEntry.Close();

        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