This command will display all server logins, server level securable, database logins and database securables.
DISA STIG implementators will find this command useful as it uses Permissions.sql provided by DISA.
Note that if you Ctrl-C out of this command and end it prematurely, it will leave behind a STIG schema in tempdb.
Check server and database permissions for servers sql2008 and sqlserver2012.
Get-DbaUserLevelPermission -SqlInstance sql2008, sqlserver2012
Check server and database permissions on server sql2008 for only the TestDB database.
Get-DbaUserLevelPermission -SqlInstance sql2008 -Database TestDB
Check server and database permissions on server sql2008 for only the TestDB database, including public and guest grants, and sys schema objects.
Get-DbaUserLevelPermission -SqlInstance sql2008 -Database TestDB -IncludePublicGuest -IncludeSystemObjects
This command was created by Brandon Abshire. You can find Brandon on his blog.