No announcement yet.

Changing Admin Password without using net.exe

  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing Admin Password without using net.exe

    Hello all,

    I've been desperately looking for a way to change the local admin password through my C# program, and thanks to you guys I know that it could be done by using the command

    net user Administrator password

    which runs the program "net.exe" and executes the command successfully. But my boss demands that the program shouldn't call another program (in this case, net.exe) to change the administrator password; he says that the proccess of changing the admin password must be done within my C# code instead. He wanted me to find a class for this purpose. But so far, I couldn't find anything helpful.

    What I understand is, I must insert a code that implements what "net user Administrator password" does, without calling net.exe to do this, which makes sense I think. Becase net.exe should be changing something, maybe inside the registry, and I must find what net.exe does.. I'm not sure but it may have something to with dll's.


  • #2
    Re: Changing Admin Password without using net.exe

    I had this same requirement, I figured that I would add the code to CodeProject as there doesn't seem to be alot of examples using this method.

    You can find the article at:

    Of course, I'm happy to answer any questions. Enjoy! I've found programming against LDAP and other DirectoryServices to be alot of fun.
    Last edited by joshperry; 3rd August 2006, 02:41.