Remove-DbaDbRole
Ben Miller (@DBAduck)
Remove-DbaDbRole View Source Ben Miller (@DBAduck) Windows, Linux, macOS Synopsis Removes custom database roles from SQL Server databases Description Removes user-defined database roles from SQL Server databases while protecting against accidental deletion of system roles. This function automatically excludes fixed database roles (like db_owner, db_datareader) and the public role, ensuring only custom roles created for specific security requirements can be removed. The function performs safety checks before removal, preventing deletion of roles that own database schemas to avoid orphaning database objects.
Read more
dbatools