SqlPermissions is used to grant, deny or revoke Server permissions for a login. For more information about permissions, please read the article Permissions (Database Engine).
Note
|
When revoking permission with PermissionState |
Source |
|
DSC Resource |
|
Documentation |
-
Target machine must be running Windows Server 2012 or later.
-
Target machine must be running SQL Server Database Engine 2012 or later.
-
Target machine must have access to the SQLPS PowerShell module or the SqlServer PowerShell module.
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Mandatory |
Hashtable[] |
List of SQL permissions. |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
InstanceName |
Key |
String |
The name of the SQL Server instance to be configured. |
|
ServerName |
String |
The host name of the SQL Server to be configured. Default value is the current computer name. |
||
Enure |
String |
Determines whether the alias should be added ( |
|
|
Principal |
Key |
String |
The login to which permission will be set. |
|
Mandatory |
Hashtable[] |
The permission to set for the login. |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Grant |
String[] |
Permission state All valid permission names can be found in the article ServerPermissionSet Class properties. |
|
|
GrantWithGrant |
String[] |
Permission state When revoking permission with PermissionState All valid permission names can be found in the article ServerPermissionSet Class properties. |
|
|
Deny |
String[] |
Permission state All valid permission names can be found in the article ServerPermissionSet Class properties. |
|
SqlPermissions:
Values:
- Name: NT SERVICE\ClusSvc$
InstanceName: MSSQLSERVER
Permission:
Grant:
- AlterAnyAvailabilityGroup
- ViewServerState
- ConnectSql
GrantWithGrant:
- ViewServerState
- ConnectSql
- Name: contoso\dbadmin
InstanceName: MSSQLSERVER
ServerName: localhost
Permission:
Grant:
- AlterAnyEndPoint
GrantWithGrant:
- ViewServerState
- ConnectSql
Deny:
- AlterAnyAvailabilityGroup
PermissionToInclude:
Grant:
- AlterAnyEndPoint
GrantWithGrant:
- ViewServerState
- ConnectSql
Deny:
- AlterAnyAvailabilityGroup
PermissionToExclude:
Grant:
- AlterAnyEndPoint
GrantWithGrant:
- ViewServerState
- ConnectSql
Deny:
- AlterAnyAvailabilityGroup