0

I have a script that runs on both the active and passive nodes and I need it to figure out if it's currently on the active node or not. I've found a little info on that with the following commands, but I want to use an if statement to filter if I'm on the active or passive node currently or not. Does anyone have any ideas how to do that? This is what I found so far:

Get-WmiObject -Class "Win32_computersystem" | Format-List -Property *

from properties of system

Get-WMIObject Win32_ComputerSystem -ComputerName {ClusterName}

from list active node in cluster

I'm just not sure how to use that to see if the current node is the active one.

Community
  • 1
  • 1
Michele
  • 3,617
  • 12
  • 47
  • 81

1 Answers1

2

For PowerShell v3 use Get-ClusterGroup. It will show what node is controlling the entire cluster, as well as, which node has control over what cluster service, disk, etc.