How to check logins for password_policy ? RRS feed

  • Question

  • Hi All,

    I'm trying to develop a simple script that checks all the logins on SQL, grabs only those with 'password policy' checked, and then looks at when the password was last set, and calculates when it will expire.

    Is there a system table/view that i can look at to find out all the SQL logins who have the 'password policy' property checked?

    I know i can use this function in SQL 2008 R2-


    LOGINPROPERTY('login', 'DaysUntilExpiration ');

    but im using SQL 2005 and first i need to gather all the logins who have the password policy enforced.

    Thanks in advance.

    Tuesday, March 29, 2011 1:33 PM


  • Oh wow, never mind, i just saw this one -


    * from sys.sql_logins

    i was just querying sys.syslogins and the one above was more comprehensive :)

    • Marked as answer by dnaman Tuesday, March 29, 2011 1:36 PM
    Tuesday, March 29, 2011 1:36 PM