How can I find out and set if an User is enabled or disabled using SQL commands? Same problem for windows policy enabled/disabled for an User.
+1
A:
You can use LOGINPROPERTY - example -
SELECT LOGINPROPERTY('John3', 'IsLocked');
GO
You can use sys.server_principals for checking enabled disabled -
SELECT * from sys.server_principals where "name" = 'loginname'
Sachin Shanbhag
2010-09-07 09:22:12