Setup: A Windows cluster who was added a new SAN disk.
Problem: Sometimes you need to scan each node for new disks in order to be able to add the disk in the cluster.
Solution:
$cluNode = "Node1" # enter the name of one node of the cluster write-host Rescan all nodes for new disks $allnodes = gwmi -ComputerName $cluNode MSCluster_node -Namespace "root\MSCluster" -Authentication PacketPrivacy -Impersonation Impersonate | select name $allnodes|%{Invoke-Command -computername $_.name -scriptblock { & echo "rescan" | diskpart | out-null }}