-
-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to add export functions for Roles #5954
Conversation
Export of server roles I can understand, but what purpose would there be in exporting database roles? |
Getting the full permissions of a role is not easy via any current process (at least that I am aware of) This is why the script from John Eisbrener was created |
I will look into the enumeration errors and also issue with SQL 2005 or earlier. |
You will also need to exclude Azure SQL from being passed in since these queries are not supported. You can just add |
Changes added to exclude unsupported versions and fix problems with offline databases |
Do you have more details on where this error is being generated? The error looks like some issue with Collation differences . What is the collation of SQL2005 instance you are testing against? |
I'd also verify what compat-level the database is in (on 80, those queries would not run). |
Thanks @wsmelton |
ohhh good call, i wouldnt have known |
looking great thank you! |
Type of Change
Purpose
Add function to export Database and Server Roles
Approach
Adds code that wraps T-SQL scripts that fully generate the Role scripts
This command is based off of John Eisbrener's post "Fully Script out a MSSQL Database Role"
Reference: https://dbaeyes.wordpress.com/2013/04/19/fully-script-out-a-mssql-database-role/
Includes changes to
Get-DbaDbRole to fix issue with offline databases
Get-DbaServerRole to exclude AzureDB's
Used with Permission
Commands to test
Get-DbaDbRole
Get-DbaServerRole
Export-DbaDbRole
Export-DbaServerRole