- First, you can try these steps from the official VMware KB. I tried this and it failed on several occasions, so I pursued another avenue.
- So if the above did not work, there are other ways to do this (I found a few in Google), but this PowerCLI was the easiest and simplest way to delete these VMs.
- Open PowerShell ISE in Administrator Mode
- Open the "Initialize-PowerCLIEnvironment.ps1 script located at C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts
- This will be here after you installed PowerCLI
- In order to get the Power CLI to connect to servers on the network, you might have to bypass the certificate error by putting in the following code:
- Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
- Then you can connect to your server with the following command:
- Connect-VIServer -Server x.x.x.x -User vsphere.local\example - Password XXXXXXX
- Once this is done, you can now start deleting the orphaned VMs in vSphere by executing the following:
- Remove-VM –VM (VM Name) –DeletePermanently –Confirm:0
- Be WARNED! This will remove the VM from vSphere and you need to make sure this is the exact one you need to delete.
This blog consists of configurations and processes I have performed in a lab environment. In no way do I recommend or imply these processes need to be followed or are the correct way to execute on any network. Perform at your own risk. Also, please feel free to leave comments if my configurations are too old/need updating.
What's Popular
-
Deploying vCSA (vCenter Server Appliance) with Embedded Platform service Controller (PSC) · First off, you will need to access ...
-
1. First off upon logging onto your UCSM you find this lovely error: 2. So what is happening here is you done messed up A A Ron!...
-
###First, create the Remote SPAN (RSPAN) VLAN. You must do this on both switches SW1#configuration terminal SW1(config)#vlan 999 SW1(config...
Meh, Whatever is Featured
Linking Active Directory to Palo Alto
###First you need to create a server profile under the LDAP section. DEVICE>Server Profiles>LDAP then click on the Add down at the bo...
Wednesday, May 16, 2018
Simple PowerCLI for Deleting Orphaned VMs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment