You are here


Discover How User Is Accessing SQL Instance (PowerShell and T-SQL)

When your security gets unruly, it can get time consuming to figure out how a user is accessing a SQL instance. Sometimes you may know that a user is getting access via one certain AD group but you aren't sure if any other groups are granting access. Furthermore, a user might be in a group that's nested in another group, through which they are gaining access to your SQL instance.

SQL Server - Disabled User Account Overrides AD Group Authorization!

Just a quick note on a scenario I ran into, and what I did to fix it:

PowerShell - List All Directories With Users Who Can Access

Maybe this is a one-off type of thing, but if you need to see every folder within a directory and get the list of who can access that folder, it can be done using PowerShell. The output is tab-separated and can easily paste into an Excel sheet.

SQL Server – Find Stored Procedures User Can Access

Returns a report that has information about user permissions for an object, or statement permissions, in the current database.

To find stored procedures that “username” can access:

exec sp_helprotect @username = 'username'

To see all objects in database and who has access:

exec sp_helprotect

For complete capabilities see

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
3 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer