My notes and ramblings, normally about automation

PowerCLI - Removing and Re-creating Unknown and/or Orphaned VMs

· Read in about 1 min · (81 Words)
ESXi PowerCLI PowerShell VMware vSphere

Ran into an issue lately where I found a host had lost its storage. For whatever reason HA didn’t kick in to bring all the VMs back to life and there was a need to recreate ~75 VMs whom were in an unknown and/or orphaned state. It looked a bit like this:

Unknown VMs

PowerCLI to the rescue!

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.