Skip to content

Powershell Script to assist implementing a simple SQL access strategy.

License

Notifications You must be signed in to change notification settings

corbra/SQL-Permissions-Datafile

Repository files navigation

Getting Started

Powershell Script to implement a simple SQL access strategy using the dbatools module.

Access is configured declaratively through a powershell psd1 data file . The file contains hashtable profiles. Each profile can be setup to configure:

  • Target SQl Instances and databases
  • New Server level roles with
    • Server Level Permissions
    • Server level role membership
  • New Database level roles with
    • database level permissions
    • Database level role membership

The RemoveExisting property is used to remove/clean existing roles targeted in the script. Once created, the function Set-LoginMappings can be used to create a simple mapping of logins/users to roles.

  • Prerequisite

    • dbatools
      • Install-Module dbatools -Scope CurrentUse
  • Sample PowerShell data file Template

    • Template
    • Contains a hash table of keys and values specifiying the permissions to apply
  • Sample execution script

Usage scenarios

About

Powershell Script to assist implementing a simple SQL access strategy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published