Having an ESX cluster is nice, and adding shared LUNs can sometimes become click redundant (host, config, storage, rescan; repeat).

Since we’ve been migrating to a new storage array, we’ve been adding quite a few LUNs to different clusters on different vCenter servers, so I wanted an easy way to rescan everything.

So here’s my script:

So you basically run rescan-storage.ps1 -vc vcenterservername -cluster clustername

-cluster isn’t only for clusters, though, you can target a host, a vDatacenter, and perhaps a folder (I only tested cluster and vDC).