Author | Andreas Jordan (@JordanOrdix), ordix.de |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Test-DbaAvailabilityGroup on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaAvailabilityGroup.
Tests the health of an Availability Group and prerequisites for changing it.
Tests the health of an Availability Group.
Can also test whether all prerequisites for Add-DbaAgDatabase are met.
Test-DbaAvailabilityGroup
[-SqlInstance] <DbaInstanceParameter>
[-SqlCredential <PSCredential>]
-AvailabilityGroup <String>
[-Secondary <DbaInstanceParameter[]>]
[-SecondarySqlCredential <PSCredential>]
[-AddDatabase <String[]>]
[-SeedingMode <String>]
[-SharedPath <String>]
[-UseLastBackup]
[-EnableException]
[<CommonParameters>]
PS C:\> Test-DbaAvailabilityGroup -SqlInstance SQL2016 -AvailabilityGroup TestAG1
Test Availability Group TestAG1 with SQL2016 as the primary replica.
PS C:\> Test-DbaAvailabilityGroup -SqlInstance SQL2016 -AvailabilityGroup TestAG1 -AddDatabase AdventureWorks -SeedingMode Automatic
Test if database AdventureWorks can be added to the Availability Group TestAG1 with automatic seeding.
The primary replica of the Availability Group.
Alias | |
Required | True |
Pipeline | false |
Default Value |
The name of the Availability Group to test.
Alias | |
Required | True |
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 |
Not required - the command will figure this out. But use this parameter if secondary replicas listen on a non default port.
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 |
Test whether all prerequisites for Add-DbaAgDatabase to add these databases to the Availability Group are met.
Use Secondary, SecondarySqlCredential, SeedingMode, SharedPath and UseLastBackup with the same values that will be used with Add-DbaAgDatabase later.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Only used when AddDatabase is used. See documentation at Add-DbaAgDatabase for more details.
Alias | |
Required | False |
Pipeline | false |
Default Value | |
Accepted Values | Automatic,Manual |
Only used when AddDatabase is used. See documentation at Add-DbaAgDatabase for more details.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Only used when AddDatabase is used. See documentation at Add-DbaAgDatabase for more details.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
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 |