Return Microsoft Cluster Resource Information

Below is sample output from running the code. NOTE, this was developed in v2.0, the cluster tested with is a Microsoft SQL Server cluster and the user executing the code needs to have administrative rights to the cluster to run it.

Note: the output is a comma-delimited format

ClusterName,NodeName,ResourceName,ResourceState,OwnerResourceGroup,ResourceType
CLUSTER01,NODE01,F:\,Online,CLUSTER01DTC,Physical Disk
CLUSTER01,NODE01,CLUSTERDTC,Online,CLUSTERDTC,Network Name
CLUSTER01,NODE01,IP Address 172.16.88.01,Online,CLUSTERDTC,IP Address
CLUSTER01,NODE01,MSDTC-CLUSTERDTC,Online,CLUSTERDTC,Distributed Transaction Coordinator
CLUSTER01,NODE01,G:\,Online,SQL Server (Default),Physical Disk
CLUSTER01,NODE01,G:\Data,Online,SQL Server (Default),Physical Disk
CLUSTER01,NODE01,G:\Log,Online,SQL Server (Default),Physical Disk
CLUSTER01,NODE01,G:\System,Online,SQL Server (Default),Physical Disk
CLUSTER01,NODE01,G:\TempDB,Online,SQL Server (Default),Physical Disk
CLUSTER01,NODE01,SQL IP Address 1 (MSCluster01),Online,SQL Server (Default),IP Address
CLUSTER01,NODE01,SQL Network Name (MSCluster01),Online,SQL Server (Default),Network Name
CLUSTER01,NODE01,SQL Server (Default),Online,SQL Server (Default),SQL Server
CLUSTER01,NODE01,SQL Server Agent (Default),Online,SQL Server (Default),SQL Server Agent
CLUSTER01,NODE01,Cluster IP Address,Online,Cluster Group,IP Address
CLUSTER01,NODE01,Cluster Name,Online,Cluster Group,Network Name
CLUSTER01,NODE01,Quorum,Online,Cluster Group,Physical Disk
CLUSTER01,NODE01,M:\MailArchive,Online,Available Storage,Physical Disk
CLUSTER01,NODE02,I:\,Online,SQL Server (Finance),Physical Disk
CLUSTER01,NODE02,I:\Data,Online,SQL Server (Finance),Physical Disk
CLUSTER01,NODE02,I:\Log,Online,SQL Server (Finance),Physical Disk
CLUSTER01,NODE02,I:\System,Online,SQL Server (Finance),Physical Disk
CLUSTER01,NODE02,I:\TempDB,Online,SQL Server (Finance),Physical Disk
CLUSTER01,NODE02,SQL IP Address 1 (MSCluster03),Online,SQL Server (Finance),IP Address
CLUSTER01,NODE02,SQL Network Name (MSCluster03),Online,SQL Server (Finance),Network Name
CLUSTER01,NODE02,SQL Server (Finance),Online,SQL Server (Finance),SQL Server
CLUSTER01,NODE02,SQL Server Agent (Finance),Online,SQL Server (Finance),SQL Server Agent
CLUSTER01,NODE02,H:\,Online,SQL Server (SPS),Physical Disk
CLUSTER01,NODE02,H:\Data,Online,SQL Server (SPS),Physical Disk
CLUSTER01,NODE02,H:\Log,Online,SQL Server (SPS),Physical Disk
CLUSTER01,NODE02,H:\System,Online,SQL Server (SPS),Physical Disk
CLUSTER01,NODE02,H:\TempDB,Online,SQL Server (SPS),Physical Disk
CLUSTER01,NODE02,SQL IP Address 1 (MSCluster02),Online,SQL Server (SPS),IP Address
CLUSTER01,NODE02,SQL Network Name (MSCluster02),Online,SQL Server (SPS),Network Name
CLUSTER01,NODE02,SQL Server (sharepoint),Online,SQL Server (sharepoint),SQL Server
CLUSTER01,NODE02,SQL Server Agent (sharepoint),Online,SQL Server (sharepoint),SQL Server Agent

The only thing in the code that would need to change is the cluster name for the variable $ClusterName

Enjoy

Anonymous