How can I use TSQL to check when a user's password will expire?

≡放荡痞女 提交于 2019-12-06 07:53:51

In SQL Server 2008, you can use SELECT LOGINPROPERTY('sa', 'DaysUntilExpiration').

For more accurate data - and also in SQL Server 2005, where DaysUntilExpiration is not supported, a combination of SELECT LOGINPROPERTY('sa', 'PasswordLastSetTime') and the password expiry policy out of Group Policy would do it.

According to SQL Server help, this function 'Requires VIEW permission on the login'.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!