Ask a Question related to ASP.NET Security, Design and Development.
-
Lina zhuang via DotNetMonster.com #1
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
-
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? ... -
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... -
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... -
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... -
change password
How can I change the password of a user from a "C" program -
Joe Kaplan \(MVP - ADSI\) #2
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
-
Lina zhuang via DotNetMonster.com #3
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
-
Lina zhuang via DotNetMonster.com #4
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



Reply With Quote

