Global return for user permission

  • I am needing to return all users on all my production servers who are either in the sys admin role or dbowner only.  For the dbo users I need to also list the associated catalogs.

    I have hundreds of users on each server and am finding a solution to be problematic.

     

    Any suggestions are appreciated.

    Kim

  • For the sysadmin, you can run a query on syslogins and check for administration with a function (isadmin(), I think?). Same for dbo, although you'll need to query each sysusers table in each database. Something like ms_foreachdb might help here. For the catalogs, you'd perform a similar query on information_schema.tables and get the catalog from there.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply