SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Security
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ChrisRusty
Starting Member

USA
1 Posts

Posted - 06/01/2012 :  11:10:49  Show Profile  Reply with Quote
Im currently trying to find a good way to verify which users have WITH GRANT permissions on the databases. I have the following script that I can run against the database and it will show me results. Only issue is we have 100s of databases and it would be hard to run against all of them. Is there a way that I could some how incorparate this into a policy or condition and have it checked that way. Im open for suggestions on a good way to manage this.

select
a.*,
b.name
from sys.database_permissions a
inner join sys.database_principals b
on a.grantee_principal_id = b.principal_id
Where state_desc = 'GRANT_WITH_GRANT_OPTION'

robvolk
Most Valuable Yak

USA
15558 Posts

Posted - 06/01/2012 :  11:21:13  Show Profile  Visit robvolk's Homepage  Reply with Quote
exec sp_MSforeachdb 'select ''?'' database_name, a.*,b.name
from .sys.database_permissions a
inner join .sys.database_principals b
on a.grantee_principal_id = b.principal_id
Where state_desc = ''GRANT_WITH_GRANT_OPTION'' '
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000