Achievements

Advertisements

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:

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.

2 Comments

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.