Daniel Lopez
Daniel Lopez

Reputation: 3391

Is it possible to check whether a password will be valid without creating an user on Windows?

I need to check if the password for an user that will be created later on in an installation process will be valid. That is, whether it will conform to the OS validation rules. Is there an API call to check if a given password will be valid? This is on Windows

Upvotes: 2

Views: 587

Answers (2)

VIK
VIK

Reputation: 689

Windows 7 Help says that in password any characters can be used:
a..z
A..Z
0..9
` ~ ! @ # $ % ^ & * ( ) _ - + = { } [ ] \ | : ; " ' < > , . ? /
and space.

Read here: http://windows.microsoft.com/en-GB/windows7/Tips-for-creating-strong-passwords-and-passphrases

Maybe it is possible to use regular expression to check the password.

Upvotes: 0

Mrchief
Mrchief

Reputation: 76218

You're looking for NetValidatePasswordPolicy function.

This can check against the local OS password policy too.

Upvotes: 2

Related Questions