Getting VHD size plus info using PowerShell for the all Virtual Machines on the cluster

Hi Guys,

This is was not a simple task… because of Get-VMHardDiskDrive can’t give you the size of the drive.

$VMget=Get-VM -ComputerName (Get-ClusterNode -Cluster ClusterName) | Get-VMHardDiskDrive | Select-Object -Property vmname, vmid, computername, controllertype, controllernumber,controllerlocation,path
foreach ($VM in $VMget) {
$VHDRemotePath=$VM.Path -replace ":", "$"
$VHDRemotePath="\\"+$VM.ComputerName+"\"+$VHDRemotePath
$vhdsize= Get-ChildItem $VHDRemotePath | select-object @{Name="SizeGB";Expression={"{0:N2}" -f ($_.length / 1GB)}}
$text = $VM.VMName + " , " + $vhdsize.SizeGB + "GB , " + $VM.Path
$text | out-file C:\Temp\VHD_Size.csv -Append
}

It exports to CSV however you still have to use “Text to Columns” in Excel.

Enjoy 🙂

How to uninstall Windows Server Essentials Experience

Hi,
Simple tip.

1. Cancel the Initial Configuration Wizard on the physical host
2. RUN -> Regedit
3. Remove the registry key telling the Wizard to auto-load:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Delete the entry named: EssentialsRoleConfigWizard

4. Open Server Manager and remove ALL roles/features, EXCEPT those specified below:
* ROLES left installed: Storage Services
* FEATURES left installed: .NET Framework 4.5(no ASP or WCF), SMB 1.0/CIFS, Graphical Management Tools, Server Graphical Shell, PowerShell 4.0, WoW64 Support
5. After removing roles/features and rebooting, you can go ahead and install the Hyper-V role then create your VM

Enjoy.

Windows Explorer is not recognizing correct space of the disk after extended it in the Disk Manager

Hi guys,

Today I am going to describe problem which happens very often on the virtual Windows machines, however I have seen people complying about this problem on the physical servers.

Problem: Windows is not recognizing correct space of the disk after extended it in the Disk Manager.
Than you noticed that yours disk needs more space, after extended space of the virtual disk in the Hyper-v you went to the disk manager and extend the disk. However Windows is still not recognizing space which you just added it.

Extended disk size

Easy fix it for this.
Go to command prompt and enter the following commands:


C:\DISKPART
C:\DISKPART>List Volume
C:\DISKPART>select volume # (select volume which has problem with recognizing space)
C:\DISKPART>extend filesystem
C:\DISKPART>exit

Screenshot 2016-01-18 10.10.27

That’s all.

Good luck.