开发者

Help needed to write SQL Query for SQL Logins

I need to write SQL Query to Retrive the Following Settings of SQL Logins for SQL server 2005:

1.Enforce password policy

2.Enforce password expiration

3.User must change password at next login

开发者_JS百科

Thanx in advance.


SELECT * 
FROM sys.sql_logins

should give you the first two (is_policy_checked and is_expiration_checked columns)

and you can use SELECT LOGINPROPERTY('sa', 'IsMustChange') to find if the user must change password at next login

So putting it all into one query...

SELECT name,
    is_policy_checked,
    is_expiration_checked, 
    LOGINPROPERTY(name, 'IsMustChange') as is_must_change
FROM   sys.sql_logins
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜