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.