@@ -159,6 +159,37 @@ Default = $true
159
159
160
160
--------------------------------------------------------------------------------------------------------------
161
161
162
+ ## Invoke-FailoverSQLCommand
163
+ ``` powershell
164
+ Invoke-FailoverSQLCommand -FailoverTargetServer <TargetServerName> -AvailabilityGroup <AGName> -Confirm:$true -ScriptOnly:$false
165
+ ```
166
+ Failover to a specific target SQL Server instance. This function does not run any health checks and is mostly used in other function mentioned above.
167
+
168
+ ### Parameters
169
+ ``` powershell
170
+ -FailoverTargetServer
171
+ ```
172
+ Target Server name
173
+
174
+ ``` powershell
175
+ -AvailabilityGroup
176
+ ```
177
+ Availability group name
178
+
179
+ ``` powershell
180
+ -ScriptOnly
181
+ ```
182
+ Script out all actions. No actions will actully be performed.
183
+ Default = $true
184
+
185
+ ``` powershell
186
+ -Confirm
187
+ ```
188
+ Prompt for confirmation prior to taking action.
189
+ Default = $true
190
+
191
+ --------------------------------------------------------------------------------------------------------------
192
+
162
193
# Availability Group Setting Functions
163
194
164
195
## Set-AGReplicaToSyncCommit
@@ -393,3 +424,57 @@ Finds the primary replica for all *secondary* AGs on the server and check the en
393
424
394
425
--------------------------------------------------------------------------------------------------------------
395
426
427
+ --------------------------------------------------------------------------------------------------------------
428
+
429
+ # Miscellaneous
430
+ ## Find-PrimaryAGNodeFromSecondaryReplica
431
+
432
+ ``` powershell
433
+ Find-PrimaryAGNodeFromSecondaryReplica -SecondaryServerInstance <ServerInstance> -AvailabilityGroup <AGName>
434
+
435
+ ```
436
+ This function will return the server name of the primary AG node regardless of which node is being queried. Helps to quickly determine the primary node regardless of which replica you pass in.
437
+
438
+
439
+ ### Parameters
440
+ ``` powershell
441
+ -SecondaryServerInstance
442
+ ```
443
+ Server name of any replica in the AG
444
+
445
+ ``` powershell
446
+ -AvailabilityGroup
447
+ ```
448
+ Availability group name
449
+
450
+ --------------------------------------------------------------------------------------------------------------
451
+
452
+ ## Get-AGTopology
453
+
454
+ ``` powershell
455
+ Get-AGTopology -PrimaryServerInstance <PrimaryServerInstance> -AvailabilityGroup <AGName>
456
+
457
+ ```
458
+ Returns the topology of an availability group in an easy to use powershell object (you need to pass in the primary server name for this to work):
459
+ - AGName
460
+ - PrimaryReplica
461
+ - TotalReplicas
462
+ - TotalSecondaryReplicas
463
+ - AllSecondaryReplicas
464
+ - SyncCommitSecondariesCount
465
+ - SyncCommitSecondaryServers
466
+ - AsyncCommitSecondariesCount
467
+ - AsyncCommitSecondaryServers
468
+
469
+ ### Parameters
470
+ ``` powershell
471
+ -PrimaryServerInstance
472
+ ```
473
+ Primary server name
474
+
475
+ ``` powershell
476
+ -AvailabilityGroup
477
+ ```
478
+ Availability group name
479
+
480
+ --------------------------------------------------------------------------------------------------------------
0 commit comments