dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Export-DbaLogin: add option to export roles that the login or its users are members of

Open ReeceGoding opened this issue 1 month ago • 0 comments

Summarize Functionality

Export-DbaLogin with -ObjectLevel is great for auditing permissions. However, it hides a nasty surprise. The long scripts it produces fool you into thinking that you must have everything, but it misses permissions granted to the user/login's roles. It scripts the membership of the role and I think it also scripts the CREATE ROLE, but it does not script any permissions for it. There should be a way to opt into this.

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

Export-DbaDbRole is quite close, but a switch letting Export-DbaLogin opt into that this what I want.

ReeceGoding avatar Dec 05 '25 20:12 ReeceGoding