Revoke-SqlAvailabilityGroupCreateAnyDatabase

Revokes the `CREATE ANY DATABASE` permission on an Always On Availability Group.

Syntax

Revoke-SqlAvailabilityGroupCreateAnyDatabase
      [[-Path] <String[]>]
      [-Script]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Revoke-SqlAvailabilityGroupCreateAnyDatabase
      [-InputObject] <AvailabilityGroup[]>
      [-Script]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Revokes the CREATE ANY DATABASE permission on an Always On Availability Group.

Examples

Example 1: How to revoke the privilege

PS C:\> Revoke-SqlAvailabilityGroupCreateAnyDatabase -Path 'SQLSERVER:\SQL\MYSERVER\MYINSTANCE\AvailabilityGroupS\AG1'

This example shows how to use the cmdlet to revoke CREATE ANY DATABASE permission for the Availability Group AG1 on SQL Server MYSERVER (instance name MYINSTANCE)

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies the target Availability Group object.

Type:AvailabilityGroup[]
Position:1
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Path

Specifies the path to the Availability Group on which this cmdlet runs the operation. If you do not specify a value for this parameter, the cmdlet uses the current working location.

Type:String[]
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Script

Indicates that this cmdlet returns a Transact-SQL script that performs the task that this cmdlet performs.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.SqlServer.Management.Smo.AvailabilityGroup[]