Set-SqlServerPermission

Sets a server level permissions.

Syntax

Set-SqlServerPermission [-sqlserver] <Object> [-permission] {AdministerBulkOperations | AlterAnyCredential | AlterAnyConnection | AlterAnyDatabase | AlterAnyEventNotification | AlterAnyEndpoint | AlterAnyLogin | AlterAnyLinkedServer | AlterResources | AlterServerState | AlterSettings | AlterTrace | AuthenticateServer | ControlServer | ConnectSql | CreateAnyDatabase | CreateDdlEventNotification | CreateEndpoint | CreateTraceEventNotification | Shutdown | ViewAnyDefinition | ViewAnyDatabase | ViewServerState | ExternalAccessAssembly | UnsafeAssembly | AlterAnyServerAudit} [-name] <String> [-action] <String> [<CommonParameters>]

Detailed Description

The Set-SqlServerPermission function sets a server permission.

Related Commands

* Set-SqlServerPermission

Parameters

Name Description Required? Pipeline Input Default Value
sqlserver    true  false   
permission    true  false   
name    true  false   
action    true  false   

Input Type

None You cannot pipe objects to Set-SqlServerPermission

Return Values

None This function does not generate any output.

Examples

EXAMPLE 1

Set-SqlServerPermission "Z002\sql2k8" "ViewServerState" "TestPSUnit" "Grant"
This command grants ViewServerState permission to the TestPSUnit login.

EXAMPLE 2

$server = Get-SqlServer "Z002\sql2k8"
Set-SqlServerPermission $server "ViewServerState" "TestPSUnit" "Grant
"
This command grants ViewServerState permission to the TestPSUnit login.