Posted On July 23, 2020

Hyper-V: Search for Guest VMs Utilizing Certain Storage Paths

kimconnect 0 comments
blog.KimConnect.com >> Virtualization >> Hyper-V: Search for Guest VMs Utilizing Certain Storage Paths
$pathSearch='C:\ClusterShare\RandomFolder'

$pathSearch='C:\ProgramData'
$allHyperVHosts={(Get-ClusterNode | Where { $_.State –eq "Up" }).Name | %{$_.ToLower()}}.Invoke() 
$allVms=foreach ($hyperVHost in $allHyperVHosts){invoke-command -computername $hyperVHost -scriptblock{Get-VM |select Name,Path}}
$allVms|?{$_.Path -like "*$pathSearch*"}

Leave a Reply

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

Related Post

Hyper-V UEFI Error: The Image’s Hash and Certificate are Not Allowed (DB)

Symptom: Cause: Secure Boot has been enabled on this generation 2 guest virtual machine. This…

PowerShell: Overcome Issues with Error 13932 in SCVMM When Refreshing Virtual Machines

Dealing with Clusters # refreshCluster.ps1 # Function to refresh a cluster in VMM in anticipation…

How To Change VMWare ESXi Hypervisor’s IP Address and Host Name

# List hypervisor's network interfaces esxcli network ip interface ipv4 get # Sample output [root@esx76:~]…