If you use SetPassword it the same as an admin resetting a user password which probably will bypass checking. you should use change password to enforce your password policy.
Main Topics
Browse All TopicsHello:
I am developing a web page for user password reset. I manage to generate the code to reset the user password by impersonation a domain admin account and using the Invoke("SetPassword", "password.123") but I need to check if the new password meets the pasword complexity requirements defined in Active directory policies.
Does any one can help me giving me an example code to check this or maybe the Invoke method used to check this?
This is an urgent request cos my boss is pushing me to finish this site so I am giving 500 points!!!!!!!!
thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Here is some code: http://dotnet247.com/247re
TMWSIY is right, there is no method of enforcing password security without running the text against the password prior to changing it, the simplest way is to test for [a-z][A-Z][0-9], run each reg expression test by itself for simplicity of reading and modifying (Yes I am very aware that you can do it in one regex test, I am also painfully aware that modifications to such regex can be extremely difficult)
Kavar,
I think your partially right. If you use the usr.Invoke("SetPassword", "password.123") then you must be a domin admin. This works because Pollin is impersonating a domain admin. However, if Pollin uses usr.Invoke("ChangePassword
I _think_ this is how it works but I have not tested it.
Hey guys
you are amazing. Didn't know that I would receive an answer so quickly.
I will use the change password method.
Thanks Kar for your contribution.
Thanks TMWSIY for the exmaples, here are your 500 points.
two last questions:
- Can you give me an example of the regex?
- do you have a link where I can check all the methods that INVOKE can call?
thanks thanks
Glad to be of help Pollin :)
Regex C# examples:
http://www.csharphelp.com/
MSDN.IADsUser:
http://msdn.microsoft.com/
PS I know how those pushy bosses can be ;)
Business Accounts
Answer for Membership
by: TMWSIYPosted on 2006-03-08 at 06:49:54ID: 16133705
You could manually check the password using regex to determine if it meets the password policy, but if your password policy changed you would have to modify your code. This is not an ideal solution but maybe a quick fix.