Skip to content

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

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.

Published inPowershellVMware


  1. Jaime Jaime


    Where is the link for the script? I am looking in every corner of your site and I am unable to find it.


    • kmruddy kmruddy

      In the above script block, the bottom informational bar gives you two options:
      The bottom left side, when clicked on, opens a new window to the file on GitHub
      The bottom right side, when clicked on, opens a new window of plaintext or you can do a right-click save-link-as and that will download the script itself.

      You also have the option to highlight portions of the script, or all of it, and copy/paste it to notepad or your favorite script editor.

Leave a Reply