Using PowerShell to Failover Availability Groups and WFC Cluster Nodes
This article will show you how to failover an AG to another node and then move the WFC role to the same secondary…
Read MoreThis article will show you how to failover an AG to another node and then move the WFC role to the same secondary…
Read MoreI recently needed to replace the older, slower attached disks on our clustered SQL instance offline so as to copy each drive to…
Read MoreHere are the steps to build at SQL Server 2017 AlwaysOn Availability Group. We will be using Windows 2016 Standard 64-bit for the…
Read MoreHere is a small cmdlet I wrote to get the currently active node in a Windows cluster:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
function Get-ClusterActiveNode { <# .SYNOPSIS Returns the active server node name for the specified Windows server cluster. .DESCRIPTION Returns the active server node name for the specified Windows server cluster. .EXAMPLE PS C:\> Get-ClusterActiveNode -ClusterCName ClusterAlias .PARAMETER ClusterName Specifies the cluster name or alias for the Windows cluster to query. .OUTPUTS The output is displayed to the console. #> [CmdletBinding(DefaultParameterSetName = 'ClusterName')] [OutputType([string], ParameterSetName = 'ClusterName')] [OutputType([string])] Param ( [Parameter(Mandatory = $true, Position = 0)] [string]$ClusterName ) try { Get-WmiObject -Class Win32_ComputerSystem -ComputerName $ClusterName | Select-Object @{ Label = "Active Node"; Expression = { $_.Name } } } catch { $exception = $_.Exception "Error attempting to retrieve cluster node information for cluster name\alias: $ClusterName" Write-Error "$exception.Message" Write-Error $exception.InnerException Write-Error $exception.Data Write-Error $exception.StackTrace } } |
Using the cmdlet as displayed…
Read MoreI was in the process of writing a few PowerShell cmdlets for a project I was working on and ran across this cmdlet…
Read More