SQL Server with Mr. Denny

Mar 29 2009   12:05AM GMT

Viewing the domain groups that are used to get into SQL

Denny Cherry Denny Cherry Profile: Denny Cherry

Tags:

Last week Linchi Shea wrote a posted a blog entry entitled “How does that AD user account get access to the database?“.  In it Linchi shows a method of finding out the domain groups that a SQL Server user uses to access the database.

There is however an easier, method you can use.

There is a system extended stored procedure called xp_logininfo.  Microsoft was even kind enough to document the procedure for us.  You can use this procedure to see what group a use belongs to, or what users are in a domain group, all from T/SQL.

For example, on my sandbox instance if I run

EXEC xp_logininfo 'CORP\dcherry'

I get a result set which says that I gained my access to the SQL Server via the “BUILTIN\Administrators” group.

This is a nice quick and easy method to see what domain group a user used to access the SQL Server.

Denny

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: