SQL Server Login Properties

SQL Server Login Properties

USE [master]
GO

SELECT [name] AS [SQL_User]
,LOGINPROPERTY([name], 'PasswordLastSetTime') AS [PasswordLastResetDT]
,LOGINPROPERTY([name], 'BadPasswordCount') AS [BadPasswordCount]
,LOGINPROPERTY([name], 'BadPasswordTime') AS [BadPasswordDT]
,LOGINPROPERTY([name], 'HistoryLength') AS [HistoryLength]
,LOGINPROPERTY([name], 'IsExpired') AS [IsExpired]
,LOGINPROPERTY([name], 'IsLocked') AS [IsLocked]
,LOGINPROPERTY([name], 'IsMustChange') AS [IsMustChange]
,LOGINPROPERTY([name], 'LockoutTime') AS [LockoutTime]
FROM [sys].[sql_logins]
GROUP BY [name];
GO

You may also like...