Posted On August 23, 2022

How to Remove ‘Ghost’ VMs with Status ‘Off-Critical’ or ‘Saved-Critical’

kimconnect 0 comments
blog.KimConnect.com >> Virtualization >> How to Remove ‘Ghost’ VMs with Status ‘Off-Critical’ or ‘Saved-Critical’

Issue:

Resolution:

get-vm|?{$_.State -in @('OffCritical','SavedCritical')}|remove-vm -force

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Get Hyper-V Cluster Automatic Balancing Configurations

# getHyperVLoadBalanceMode.ps1 $clustername=(Get-Cluster).Name function getHyperVLoadBalanceMode($clustername=(Get-Cluster).Name){ $AutoBalancerLevel=[hashtable]@{ '1'='Low | Move when host is more than 80%…

How To Inject NIC Drivers into the ESXi Installation Image

Update 1/10/2021: ESXi-7.0 isn't compatible with the drivers in our previous illustration. Thus, this is…

PowerShell: List All Hyper-V Snapshots of All VMs in All Clusters in Domain

# listHyperVSnapshots.ps1 $clusterName='*' function listAllHyperVSnapshots([string[]]$clusterName){ function includeRSAT{ $ErrorActionPreference='stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 #$rsatWindows7x32='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x86-RefreshPkg.msu' $rsatWindows7x64='https://download.microsoft.com/download/4/F/7/4F71806A-1C56-4EF2-9B4F-9870C4CFD2EE/Windows6.1-KB958830-x64-RefreshPkg.msu' $rsatWindows81='https://download.microsoft.com/download/1/8/E/18EA4843-C596-4542-9236-DE46F780806E/Windows8.1-KB2693643-x64.msu' $rsat1709…
Other project: DragonCoin.com