Saturday 15 September 2012

sql server - Looking for a script which will script out all database level persmissions( including xp_cmdshell and sql proxy account) -


I need a stored procedure or script that will script all database level permissions - including the permission of xp_cmdshell, Along with any object, as well as allowing a SQL Proxy account.

Thank you!

Your problem is that xp_cmdshell is allowed to have a master database, so long as you do not run the database on the server , You will not be able to do what you want to do if you are trying to give all the permissions for a proxy account to the database, then you should put that account in the db_owner database role, and this Receive those rights through role membership And should. Xp_cmdshell has a distinct clear grant in the master, and should be enabled through sp_configure, and should be used for legacy integration, it should not be used for new development work at the very least, if you use XPICM & SSL Then a proxy account should be setup after example of Tibor:

Write permissions for a specific user by query of DMV The following:

  Select permission.state_desc, or obj inner join the permission.permission_name, obj.name as sys.all_objects as allowed as sys.database_permissions allowed. Major_id = obj.object_id and permission Minor_id = 0 and permission.class = 1 INNER JOIN as grantor_principals as grantor_principals grantor_principal.principal_id = permission.grantor_principal_id INNER as sys.database_principals grantee_principal grantee_principal.principal_id = permission.grantee_principal_id WHERE (grantee_principal.name = N'JohnDoe ')  

No comments:

Post a Comment