Showing posts with label Hyper-V. Show all posts
Showing posts with label Hyper-V. Show all posts

Monday, February 24, 2014

PowerShell to seach Hyper-V VM Hard Disks for a specific VHD/VHDX file path

Sometimes people may not always place the VHD/VHDX files in the path your expecting them to be which if this is on a different partition it could cause some administrative overhead when managing the disk space on your host server. I was faced with this problem and came up with the following little PowerShell script to help search all VMs for an attached disk with the path of the VHD file I found.

$VHDToFind = Read-Host "Enter the Full Path to the VHD that you want to search for?"
Get-VM | ForEach-Object {$vmHDD = Get-VMHardDiskDrive -VMName $_.Name; if ($vmHDD.Path -EQ $VHDToFind) {Write-Host "VHD attached to $($vmHDD.VMName)" -ForegroundColor Green;}}


Monday, November 11, 2013

Migration Automation Toolkit (MAT) - Best video I have seen in a while

This would have to be the best video I have seen in a while. It speaks for it self.

View Video

Obviously you need a NetApp storage device for this toolkit to work. But it is built on PowerShell so what I see is an opportunity to take the scripts and modify them for your environment even if you don't have a NetApp device there would be some use in the scripts to help you get started in automating your migrations.

Read about it http://migrate.azurewebsites.net/