Jump to content

setting password in active directory through code using system.directory services


avisekrishi

Recommended Posts

I have a C# page to create a new Active Directory user and it's works fine if the password given meets w/ the policy requirements, but if it doesn't this exception is thrown:The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements. (Exception from HRESULT: 0x800708C5)I'm looking for a way to make sure that the password meets the requirements before I try to create the user. I could write a custom validator and manually check the length, case, etc, but it seems like there would be a built-in method I can call that will pull the policy requirements and check them or at least a way to pull the requirements from AD. Otherwise the validator would have to be updated any time the policy changed. What would be a good way to handle this?

Link to comment
Share on other sites

I have a C# page to create a new Active Directory user and it's works fine if the password given meets w/ the policy requirements, but if it doesn't this exception is thrown:The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements. (Exception from HRESULT: 0x800708C5)I'm looking for a way to make sure that the password meets the requirements before I try to create the user. I could write a custom validator and manually check the length, case, etc, but it seems like there would be a built-in method I can call that will pull the policy requirements and check them or at least a way to pull the requirements from AD. Otherwise the validator would have to be updated any time the policy changed. What would be a good way to handle this?
Have a look at this which sheds some light.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...