I am using wix installer to check the Checkbox for "Enforce Password Expiration" under Securty -> Logins for the sa user after sql express is installed. I guess the easiest way is to edit the Registry key to check this checkbox automatically. Can anyone help me where the relevant registry key is located.
Asked
Active
Viewed 57 times
1 Answers
0
The “Enforce Password Expiration” option is not stored within the Windows registry.
It’s typically stored within the SQL server itself, and I believe a T-SQL script for it would be something along these lines:
ALTER LOGIN [sa] WITH CHECK_EXPIRATION=ON, CHECK_POLICY = ON
Which you can execute using sqlcmd from within your WiX installer or as a custom action.
For example:
sqlcmd -S .\SQLEXPRESS -U sa -P <your_password> -i "path\to\EnablePasswordExpiration.sql"
Might work.
Obviously with your actual password and the actual path to the script.