For Help: How I can change the password ploicy.

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default For Help: How I can change the password ploicy.

    Dear Sir,
    I change password of users in active directory by asp.net
    form ( c# ) .But I recieve error could anyone help me to
    solve it. Thanks very much.

    This is error info.
    ------------------------------
    [COMException (0x800708c5): ????????????????????????????????????]

    [TargetInvocationException: ???????????]
    pnet_portal.ChangePassword.btnOK_Click(Object sender, EventArgs e) in c:\
    inetpub\wwwroot\pnet_portal\ChangePassword.aspx.cs :66
    System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent
    (String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    sourceControl, String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
    System.Web.UI.Page.ProcessRequestMain()
    -------------------------------
    I have changed policy but it isn't effected.
    Otherwise, I'm sorry, my English is not well.

    --
    Message posted via [url]http://www.dotnetmonster.com[/url]
    Lina zhuang via DotNetMonster.com Guest

  2. Similar Questions and Discussions

    1. How to change password
      I have inherited a contribute site from a former employee. He has not given us the administrator password to the site. How do I change it? ...
    2. How do you change the password?
      Hello, I am having trouble logging into the administrator account. I'm new at this program and I'm not sure how to open the program up at all! I've...
    3. Can't change password?
      Heya; I have PostGreSQL 7.3.4 on Mandrake Linux 9.2. For some reason Webmin, when I tell it to change the password of a pgsql user, acts like it's...
    4. netadmin & change password
      Hello, I have been reading about the change password function in NetAdmin (Win32). Now it says I need to input the old password. What is I am in...
    5. change password
      How can I change the password of a user from a "C" program
  3. #2

    Default Re: For Help: How I can change the password ploicy.

    Err.exe says that 0x800708C5 = "password too short". Are you sure the
    password you tried to use is in compliance with your password policy?

    Also, remember that ChangePassword always throws a TargetInvocationException
    with the real exception in the InnerException property. This is because
    ChangePassword is called via Reflection.

    HTH,

    Joe K.

    "Lina zhuang via DotNetMonster.com" <forum@DotNetMonster.com> wrote in
    message news:12da303cef5c4481be9706934efe3cee@DotNetMonste r.com...
    > Dear Sir,
    > I change password of users in active directory by asp.net
    > form ( c# ) .But I recieve error could anyone help me to
    > solve it. Thanks very much.
    >
    > This is error info.
    > ------------------------------
    > [COMException (0x800708c5): ????????????????????????????????????]
    >
    > [TargetInvocationException: ???????????]
    > pnet_portal.ChangePassword.btnOK_Click(Object sender, EventArgs e) in
    > c:\
    > inetpub\wwwroot\pnet_portal\ChangePassword.aspx.cs :66
    > System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    >
    > System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent
    > (String eventArgument)
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    > sourceControl, String eventArgument)
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
    > System.Web.UI.Page.ProcessRequestMain()
    > -------------------------------
    > I have changed policy but it isn't effected.
    > Otherwise, I'm sorry, my English is not well.
    >
    > --
    > Message posted via [url]http://www.dotnetmonster.com[/url]

    Joe Kaplan \(MVP - ADSI\) Guest

  4. #3

    Default Re: For Help: How I can change the password ploicy.

    Thanks,Joe K.
    But, question is that I want to use short password. But it is not allowed.
    So I think I need to change the password policy. After I changed the
    password policy in 'Group Policy Editer', I succeed to change password
    which is short in Active Directory. But it also can't be allowed through
    running my program. I also recieve the same error. I don't know why and how
    I can do.

    --
    Message posted via [url]http://www.dotnetmonster.com[/url]
    Lina zhuang via DotNetMonster.com Guest

  5. #4

    Default Re: For Help: How I can change the password ploicy.

    And there a new question.
    To solve the original question I try other way. I am invoking the
    'SetPassword' method (replace the 'ChangePassword' method) on the
    DirectoryEntry object, and use 'administrator' status. This successfully
    changes the passsword for the user and I can login with the new password.
    It is short password.
    But, question appear, the old password is also valid so I can login
    with either the new or old password. When I close the page and exit program
    environment, or logout, the old password is invalid.

    This is code.
    -------------------
    string adpath = "LDAP://" + ConfigurationSettings.AppSettings["MydcCom"];
    string[] strADAdmin = ConfigurationSettings.AppSettings["ADAdminString"]
    ..Split(new char[]{','});

    //strADAdmin[0]--administrator; strADAdmin[1]--password
    DirectoryEntry entry = new DirectoryEntry(adpath, strADAdmin[0], strADAdmin
    [1]);
    DirectoryEntry userEntry = new DirectoryEntry();
    try
    {
    object obj = entry.NativeObject;
    DirectorySearcher search = new DirectorySearcher(entry);
    search.Filter = "(SAMAccountName=" + loginName + ")";
    search.SearchScope = SearchScope.Subtree;
    search.CacheResults = false;

    SearchResultCollection results = search.FindAll();
    foreach( SearchResult result in results )
    {
    userEntry = result.GetDirectoryEntry();
    break;
    }

    if( userEntry != null )
    {
    userEntry.Invoke("SetPassword", new object[]{newPwd});
    userEntry.CommitChanges();
    }

    return true;
    }
    -------------------

    Thanks.

    --
    Message posted via [url]http://www.dotnetmonster.com[/url]
    Lina zhuang via DotNetMonster.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139