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

PowerShell: Find Guest VMs Associated with a Certain Storage Path

# findGuestMvsByStorage.ps1 $storagePath='\\SMBSERVER009' function getAllGuestVms($clusterName){ try{ Import-Module FailoverClusters $clusterName=if($clusterName){ $clustername }else{ (get-cluster).name } $allHyperVHosts={(Get-ClusterNode -Cluster…

Limitations: VM Import to AWS

VM to AWS instance limitations: - Cannot import VMs that have been created via P2V…

PowerShell: Create Hyper-V Guest VM From Virtual Disk (VHDX)

Part 1: Creating Hyper-V Guest VM From a Virtual Disk # createHyperVGuestVmFromDisk.ps1 # Version 0.02…