dbTalk Databases Forums  

Last Time Guest Account Used SQL Server 2005

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss Last Time Guest Account Used SQL Server 2005 in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe K.
 
Posts: n/a

Default Last Time Guest Account Used SQL Server 2005 - 08-27-2009 , 10:20 AM






Is there away to determine the last time the guest account was used on a SQL
Server 2005 database server?

Thanks,

Reply With Quote
  #2  
Old   
Linchi Shea
 
Posts: n/a

Default RE: Last Time Guest Account Used SQL Server 2005 - 08-27-2009 , 11:11 AM






No unless you have already set up some kind of audit trace.

Linchi

"Joe K." wrote:

Quote:
Is there away to determine the last time the guest account was used on a SQL
Server 2005 database server?

Thanks,

Reply With Quote
  #3  
Old   
Uri Dimant
 
Posts: n/a

Default Re: Last Time Guest Account Used SQL Server 2005 - 08-30-2009 , 02:35 AM



Joe
Try create a LOG ON ddl trigger , you can change the logic behind to
INSERT the data into a table or DENY ACCESS to the login i

Create login AuditLogin with password = ‘AuditLoginPswd’
go
/*Create a very simple login trigger */
create trigger AuditLogin_Demo
/* server means instance level*/
on all server
with execute as self
/* We specify the logon event at this stage
– If there are more than one connections,
– Issue a rollback*/
for logon
as begin
IF ORIGINAL_LOGIN()= ‘AuditLogin’ AND
(SELECT COUNT(*) FROM sys.dm_exec_sessions
WHERE is_user_process = 1 AND
original_login_name = ‘AuditLogin’) > 1
ROLLBACK;

end
go

"Joe K." <JoeK (AT) discussions (DOT) microsoft.com> wrote

Quote:
Is there away to determine the last time the guest account was used on a
SQL
Server 2005 database server?

Thanks,

Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Last Time Guest Account Used SQL Server 2005 - 08-30-2009 , 10:10 AM



Joe K. (JoeK (AT) discussions (DOT) microsoft.com) writes:
Quote:
Is there away to determine the last time the guest account was used on a
SQL Server 2005 database server?
Unless you have created a login called "guest", there is any such account.

In all databases there is a *user* guest, which is used under some
cicrumstances that I don't remember on the top of my head now. But I
think it has to do when you access a database from another database in
which you do not have a user mapped to your login, but the access is
still valid due to ownership chaining. As far as I know, you cannot
track that.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.