Windows Cluster Information through powershell
The below script extract information about Cluster resource status in Windows Cluster
cls #ClusterResource $GetClusterInfo=Get-ClusterResource $GetClusterInfo| ForEach-Object{ $GetClustInfo=$_ if($GetClustInfo.State -ne 'Online') { $GetClustInfo|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor Red } else { $GetClustInfo|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor Green } }; #Cluster Netwok $GetClusterNetwork=Get-ClusterNetwork $GetClusterNetwork| ForEach-Object{ $GetClustNet=$_ if($GetClustNet.State -ne 'UP') { $GetClustNet|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor Red } else { $GetClustNet|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor DarkYellow } }; #Cluster NetworkInterface $GetClustNetInterface=Get-ClusterNetworkInterface $GetClustNetInterface| ForEach-Object{ $GetClustNetINter=$_ if($GetClustNetINter.State -ne 'UP') { $GetClustNetINter|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor Red } else { $GetClustNetINter|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor DarkMagenta } }; #Get ClusterNode $GetClustNode=Get-ClusterNode $GetClustNode|ForEach-Object{ $GetClusterNodes=$_ if($GetClusterNodes.State -ne 'UP') { $GetClusterNodes|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor Red } else { $GetClusterNodes|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor Cyan } }; #Virtual Disk info $GetVirtualDisk=Get-VirtualDisk $GetVirtualDisk|ForEach-Object{ $GetVDisk=$_ if(($GetVDisk.OperationalStatus -ne 'OK')-OR($GetVDisk.HealthStatus -NE 'Healthy')) { $GetVDisk|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor Red } else { $GetVDisk|Format-Table -AutoSize|Out-String|Write-Host -ForegroundColor DarkYellow } }
Comments