Invoke-sqmSqlAlwaysOnAutoSeeding
Always OnsqmSQLTool v1.8.2+ · Configuration⚠ Requires SQL 2016+ ✓ Prerequisites
Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string | Required | — | Primary replica instance. |
| -SqlCredential | PSCredential | Optional | — | Credentials for primary and replicas. |
| -AvailabilityGroup | string | Required | — | Name of the availability group. |
| -SqlVersion | int | Optional | Auto-detect | SQL Server version (2016, 2017, 2019, 2022). Auto-detected if omitted. |
| -ValidateOnly | switch | Switch | $false | Check prerequisites without making changes. |
| -EnableException | switch | Switch | $false | Re-throw exceptions immediately. |
| -WhatIf / -Confirm | switch | Optional | — | ShouldProcess (ConfirmImpact: High) guards configuration changes. |
Execution Flow
Examples
Validate AutoSeeding prerequisites (no changes)
Invoke-sqmSqlAlwaysOnAutoSeeding -SqlInstance "SQL01" -AvailabilityGroup "AG_Prod" -ValidateOnly
Enable AutoSeeding on AG with -WhatIf
Invoke-sqmSqlAlwaysOnAutoSeeding -SqlInstance "SQL01" -AvailabilityGroup "AG_Prod" -WhatIf