September 30, 2011 at 12:45 pm
How to find the below information in SQL server 2000 .
1)List the Logins which are disabled
2)List are logins which have not been used in past 180 days.
Can any one give the above information as i need it for some audit purpose.
September 30, 2011 at 1:23 pm
1)List the Logins which are disabled
select * from sys.server_principals where is_disabled = 1
2)List are logins which have not been used in past 180 days.
Aside from a login trace I don't know there is a reliable way to determine this. Here is a thread from here discussing this topic http://www.sqlservercentral.com/Forums/Topic641210-359-1.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 30, 2011 at 2:05 pm
Sean, that query is 2005 and above. 🙂
For 2000:
SELECT [name]
FROM syslogins
WHERE denylogin = 1
OR hasaccess = 0;
As for your second question, SQL Server doesn't track last login. Therefore, there's no way of telling without doing traces over a period of time.
K. Brian Kelley
@kbriankelley
September 30, 2011 at 2:07 pm
K. Brian Kelley (9/30/2011)
Sean, that query is 2005 and above. 🙂For 2000:
SELECT [name]
FROM syslogins
WHERE denylogin = 1
OR hasaccess = 0;
As for your second question, SQL Server doesn't track last login. Therefore, there's no way of telling without doing traces over a period of time.
Well silly me, I assumed being in the 2008 forum...didn't see the OP stating 2000.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply