In (SQL 2005 or 2008), is it possible to run a custom query against system tables, or to run some sp_help* proc, that would display all permissions for a given user in the database, including those inherited from AD Group memberships?
Update #1
I am wanting to see all users that have permissions by virtue of membership in AD Groups (that have been granted permissions in the database). So is [UserA] is a member of AD group [SuperUsers], and [SuperUsers] belongs to the SQL Role db_datareader, then I am hoping to see [UserA] with db_datareader permissions. ([UserA] in this case has not explicitly been directly granted any permissions to the database, all permissions are inherited from group [SuperUsers]
To test the examples posted so far, I added a new user to my database, set its login name to a known AD group, and granted db_datareader to the AD Group. What I am wanting to see is, all AD users within that AD group will be seen within this query.
I am not seeing this output using any of the posted examples. Are they providing something different, or do they actually do what I want, but my test configuration is wrong?
Perhaps this is literally not possible, as it would require SQL Server to be able to enumerate Active Directory Groups, which perhaps it simply cannot do?
Update #2
SQL Server is not natively aware of AD Users within AD Groups, so it is not possible to accomplish this.
Note: another question related to this (but dealing with SQL Server users and roles, not AD Users and groups) can be found here:
SQL Server query to find all permissions/access for all users in a database