Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Set-DbaAvailabilityGroup on GitHub.
Want to see the Bill Of Health for this command? Check out Set-DbaAvailabilityGroup.
Sets availability group properties on a SQL Server instance.
Sets availability group properties on a SQL Server instance.
Set-DbaAvailabilityGroup
[[-SqlInstance] <DbaInstanceParameter[]>]
[[-SqlCredential] <PSCredential>]
[[-AvailabilityGroup] <String[]>]
[-AllAvailabilityGroups]
[-DtcSupportEnabled]
[[-ClusterType] <String>]
[[-AutomatedBackupPreference] <String>]
[[-FailureConditionLevel] <String>]
[[-HealthCheckTimeout] <Int32>]
[-BasicAvailabilityGroup]
[-DatabaseHealthTrigger]
[-IsDistributedAvailabilityGroup]
[[-InputObject] <AvailabilityGroup[]>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Get-DbaAvailabilityGroup -SqlInstance sql2016 | Set-DbaAvailabilityGroup -DtcSupportEnabled
Enables DTC for all availability groups on sql2016
PS C:\> Get-DbaAvailabilityGroup -SqlInstance sql2016 -AvailabilityGroup AG1 | Set-DbaAvailabilityGroup -DtcSupportEnabled:$false
Disables DTC support for the availability group AG1
PS C:\> Set-DbaAvailabilityGroup -SqlInstance sql2016 -AvailabilityGroup AG1 -DtcSupportEnabled:$false
Disables DTC support for the availability group AG1
The target SQL Server instance or instances. Server version must be SQL Server version 2012 or higher.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Only set specific availability group properties.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Set properties for all availability group on an instance.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Enables DtcSupport.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Cluster type of the Availability Group. Only supported in SQL Server 2017 and above.
Options include: External, Wsfc or None.
Alias | |
Required | False |
Pipeline | false |
Default Value | |
Accepted Values | External,Wsfc,None |
Specifies how replicas in the primary role are treated in the evaluation to pick the desired replica to perform a backup.
Alias | |
Required | False |
Pipeline | false |
Default Value | |
Accepted Values | None,Primary,Secondary,SecondaryOnly |
Specifies the different conditions that can trigger an automatic failover in Availability Group.
Alias | |
Required | False |
Pipeline | false |
Default Value | |
Accepted Values | OnAnyQualifiedFailureCondition,OnCriticalServerErrors,OnModerateServerErrors,OnServerDown,OnServerUnresponsive |
This setting used to specify the length of time, in milliseconds, that the SQL Server resource DLL should wait for information returned by the sp_server_diagnostics stored procedure before reporting
the Always On Failover Cluster Instance (FCI) as unresponsive.
Changes that are made to the timeout settings are effective immediately and do not require a restart of the SQL Server resource.
Defaults is 30000 (30 seconds).
Alias | |
Required | False |
Pipeline | false |
Default Value | 0 |
Indicates whether the availability group is Basic Availability Group.
https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/basic-availability-groups-always-on-availability-groups
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Indicates whether the availability group triggers the database health.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Indicates whether the availability group is distributed.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Enables piping from Get-DbaAvailabilityGroup.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Shows what would happen if the command were to run. No actions are actually performed.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
Prompts you for confirmation before executing any changing operations within the command.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |