PowerCLI One-Liner Rescan All HBA’s

As I have the worst luck remembering what this is each and every time I need it, I’m throwing it up here for quick reference.

Get-VMHost | Get-VMHostStorage -RescanAllHba

Yes, it really is that simple. You can use a few of the other Get-* search functions to narrow the list of hosts, say for all hosts in a cluster:

Get-Cluster -Name “ProVMware” | Get-VMHost | Get-VMHostStorage -RescanAllHba

Hopefully this will be as helpful for you as it was me.

6 thoughts on “PowerCLI One-Liner Rescan All HBA’s

  • Pingback: Rescan All HBA’s from PowerCLI | vSential.com
  • Pingback: Rescan All HBA’s from PowerCLI | vSential
  • Effin eh Cotton. So many options on the internet using for loops I thought to myself it has to be easier. And it is.

    Thanks for this!!!

  • Damn, looks like the free ESX license doesn’t allow this… “Current license or ESXi version prohibits execution of the requested operation”

Comments are closed.