locked
Reset Active Directory Passwords RRS feed

  • Question

  • User-21224605 posted

    Hi everybody. Can someone among all you, for the sake of God, consider my situation and provide me with a piece of code, a real solution and help me forget my nightmare??!! Yes, I want to have a single page which is able to reset (not change) Active Directory passwords. Here is my situation :

    1- Active Directory and IIS are on the same machine.

    2- We don't have (and don't want to) SSL installed. Installation of AD has been done with default options.

    3- We have administrator password.

    4- We need a single page, with two Textboxes(one for username and another for the new password) and a Button,  probably labeled as "Reset"

    I have tested thousands of examples and hundreds of web.config and IIS settings combinations! Please don't refer me to other posts or websites. Give me working code instead. Please provide me about needed configuration and   settings (web.config, IIS, ...)

    Please help me. Please. Please. 

    Sunday, February 21, 2010 8:17 AM

All replies

  • User-1659704165 posted

    Hi,

    public void ResetPassword(string userDn, string password)
    {
        DirectoryEntry uEntry = new DirectoryEntry(userDn);
        uEntry.Invoke("SetPassword", new object[] { password });
        uEntry.Properties["LockOutTime"].Value = 0; //unlock account

        uEntry.Close();
    }

    OR

    http://www.codeproject.com/KB/system/everythingInAD.aspx#46

    http://www.primaryobjects.com/CMS/Article66.aspx

    chk the  above Link

    Monday, February 22, 2010 1:11 AM
  • User-21224605 posted

    Hi. Thanks for the reply. But what about Web.config and IIS settings? What about impersonation? What about IWA? What about SSL and Kerberos? If it was that simple, I have had done this already!! 

    Monday, February 22, 2010 4:20 AM
  • User-1659704165 posted

    Chk the above link of codeproject it has most of operation which U may do with Active Directory.

    Other OperatioN which You are Talking then better u Use WMI This may help U

    Monday, February 22, 2010 4:32 AM
  • User-21224605 posted

    I checked thousands of web pages and tried their code, but nothing seems to work properly. Many of them say that SSL is required. Some mention the use of Kerberos. And a lot of them involve impersonation. You say WMI. Can you give me more information please?

    Monday, February 22, 2010 4:42 AM
  • User-1659704165 posted

    What Exctally u want if only want change the username and password.. the codeproject link may help U.

    what are other process u want.

    Monday, February 22, 2010 5:01 AM
  • User-21224605 posted

    Yes. The only thing I want to do is to RESET a user's password in AD. Everywhere on the Internet there are articles about impersonation. Haven't you heard about that? The code you suggested simply doesn't work because it will be run under  ASPNET account security context.  

    Tuesday, February 23, 2010 12:12 AM
  • User-1659704165 posted

    Yes. The only thing I want to do is to RESET a user's password in AD. Everywhere on the Internet there are articles about impersonation. Haven't you heard about that? The code you suggested simply doesn't work because it will be run under  ASPNET account security context.  


    U may try impersonation That is your Wish. But when i have Implemnted I have Given Some specific Rights to user  for AD operation.

    example :- u may not we Knowing creating Group and domain.

     impersonation may we use full in Short Goals in long term u have to create Groups and Domains with speicifc Rights.

    define the Hinearchy First .You are using Active dir not database.

    Tuesday, February 23, 2010 12:23 AM