As part of a project to create a tool to query all sorts of permissions relevant to users in our area at work, I need to query some information about our database servers. The servers run SQL Server 2005 (including instances of Analysis Services 2005). I need to be able to find for a given server:
- The list of logins on that server
- The list of roles on that server
- What each role has rights to
- Who is in each role (or for each login, what roles does it belong to - either way works)
The application is currently written in Perl, so if you know of techniques to use to query this information using Perl, I would be very thankful. The only other application language I can work with is PHP, but that is to be avoided for consistency reasons if at all possible.