Generate Role Member Reports using dbatools and the ImportExcel PowerShell modules

As one of dbatools’ first members, I’ve been using it for years and it’s really my goto tool. This task was no different!

Today’s tip and trick using dbatools is about generating an Excel workbook that contains lists of SQL Server roles and its members.

The Usefulness of these Reports

These reports are especially useful when performing tech-refreshes (migrating from an old version to a newer one) and you want to do some housekeeping. For example, finding logins that should be part of a role and they are not. Once you know there are problems, you decided to do a double-check on