Hyper-V Reporting Script (Powershell & HTML)

It can be difficult to monitor and assess resources in large Hyper-V environments. This Powershell based script helps you to understand virtualization inventory, capacity and general resource availability in your Standalone or Clustered Hyper-V Environment.

 
 
 
 
 
4.9 Star
(96)
30,929 times
Add to favorites
Servers
3/5/2015
E-mail Twitter del.icio.us Digg Facebook
  • Unable to run the script
    1 Posts | Last post June 07, 2018
    • Get-WindowsFeature : A parameter cannot be found that matches parameter name 'ComputerName'.
      At C:\TEMP\Scripts\Get-HyperVReport.ps1:885 char:41
      +                 if ((Get-WindowsFeature -ComputerName $env:COMPUTERNA ...
      +                                         ~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (:) [Get-WindowsFeature], ParameterBindingException
          + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Windows.ServerManager.Commands.GetWindowsFeatureCommand
      
      Get-WindowsFeature : A parameter cannot be found that matches parameter name 'ComputerName'.
      At C:\TEMP\Scripts\Get-HyperVReport.ps1:911 char:45
      +                     if ((Get-WindowsFeature -ComputerName $env:COMPUT ...
      +                                             ~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (:) [Get-WindowsFeature], ParameterBindingException
          + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Windows.ServerManager.Commands.GetWindowsFeatureCommand
      
      [INFO]    - 09:27:43 - BMSCLUSTER is accessible. Gathering Node information...
      [INFO]    - 09:27:46 - Checking prerequisites for Hyper-V Cluster reporting...
      Get-WindowsFeature : A parameter cannot be found that matches parameter name 'ComputerName'.
      At C:\TEMP\Scripts\Get-HyperVReport.ps1:1175 char:41
      +                 if ((Get-WindowsFeature -ComputerName $clusterOwnerHo ...
      +                                         ~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (:) [Get-WindowsFeature], ParameterBindingException
          + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Windows.ServerManager.Commands.GetWindowsFeatureCommand
  • DMZ / Linux Virtual Machines
    1 Posts | Last post May 24, 2018
    • Hi,
      
      DMZ or Linux machines are stated as offline, i believe because security reasons? How can we bypass this?
      
      Many thanks
  • Get-VHD : Cannot validate argument on parameter 'Path'
    1 Posts | Last post May 22, 2018
    • Getting the below error when I run it for standalone Hyperv2016
      ****************************************
      Get-VHD : Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
      At E:\Scripts\Windows PowerShell\Get-HyperVReport.ps1:2245 char:83
      + ...     $vmDiffDisk = Get-VHD -ComputerName $VMHostItem -Path $parentPath
      +                                                               ~~~~~~~~~~~
          + CategoryInfo          : InvalidData: (:) [Get-VHD], ParameterBindingValidationException
          + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Vhd.PowerShell.Cmdlets.GetVHD
      
      
      Not much info in the logs 
      [DEBUG]   - 17.May.2018 09:06:39 - ----- Start -----
      [INFO]    - 17.May.2018 09:06:39 - Logging started: E:\Scripts\Windows PowerShell\ScriptLog.txt
      [INFO]    - 17.May.2018 09:06:42 - Checking prerequisites to run script on the HYPERV2016...
      [DEBUG]   - 17.May.2018 09:06:42 - HYPERV2016: Operating system is supported as script runtime environment.
      [DEBUG]   - 17.May.2018 09:06:44 - HYPERV2016: Hyper-V PowerShell Module is OK.
      [INFO]    - 17.May.2018 09:06:44 - Checking prerequisites for standalone Hyper-V host(s) reporting...
      [DEBUG]   - 17.May.2018 09:06:48 - HYPERV2016: Operating system version and Hyper-V role is OK.
      [INFO]    - 17.May.2018 09:06:48 - Available Hyper-V server(s) for reporting: HYPERV2016
      [INFO]    - 17.May.2018 09:06:51 - Gathering Hyper-V Host information...
      [INFO]    - 17.May.2018 09:07:03 - Gathering Virtual Machine information...
  • Incompatible operating system version
    4 Posts | Last post May 17, 2018
    • Getting error while running the script on HyperV2016. Is there a way to make this work on HyperV 2016
      
      
      PS E:\Scripts\Windows PowerShell> .\Get-HyperVReport.ps1 -VMHost HYPERV2016
      [INFO]    - 15:36:57 - Started! Hyper-V Reporting Script (Version 1.5)
      [INFO]    - 15:37:00 - Logging started: E:\Scripts\Windows PowerShell\ScriptLog.txt
      [INFO]    - 15:37:03 - Checking prerequisites to run script on the HYPERV2016...
      [ERROR]   - 15:37:03 - HYPERV2016: Incompatible operating system version detected. Supported operating systems are Windows Server 2012 and Windows Server 2012 R2.
      [ERROR]   - 15:37:03 - Script terminated!
    • Getting Error  HYPERV2016: Incompatible operating system version detected. Supported operating systems are Windows Server 2012 and Windows Server 2012 R2.
      
      I have already tried 
      
      Line 838 and Line 1261
      
      1st i Try this
      
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*"))
      
      2nd I Try this
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "*")) 
      
      3rd I ty this
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*") -or ($OsVersion -like "*"))
      
    • If you are Running 2016 Hyper-v Cluster the you have to produce changes 
      
      Open Script on Notepad ++
      
      Line 838, 1173 and 1261 Produce the below changes. 
      
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*") -or ($OsVersion -like "*"))
    • Getting the below error when I run it for standalone Hyperv2016
      ****************************************
      Get-VHD : Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
      At E:\Scripts\Windows PowerShell\Get-HyperVReport.ps1:2245 char:83
      + ...     $vmDiffDisk = Get-VHD -ComputerName $VMHostItem -Path $parentPath
      +                                                               ~~~~~~~~~~~
          + CategoryInfo          : InvalidData: (:) [Get-VHD], ParameterBindingValidationException
          + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Vhd.PowerShell.Cmdlets.GetVHD
      
      
      Not much info in the logs 
      [DEBUG]   - 17.May.2018 09:06:39 - ----- Start -----
      [INFO]    - 17.May.2018 09:06:39 - Logging started: E:\Scripts\Windows PowerShell\ScriptLog.txt
      [INFO]    - 17.May.2018 09:06:42 - Checking prerequisites to run script on the HYPERV2016...
      [DEBUG]   - 17.May.2018 09:06:42 - HYPERV2016: Operating system is supported as script runtime environment.
      [DEBUG]   - 17.May.2018 09:06:44 - HYPERV2016: Hyper-V PowerShell Module is OK.
      [INFO]    - 17.May.2018 09:06:44 - Checking prerequisites for standalone Hyper-V host(s) reporting...
      [DEBUG]   - 17.May.2018 09:06:48 - HYPERV2016: Operating system version and Hyper-V role is OK.
      [INFO]    - 17.May.2018 09:06:48 - Available Hyper-V server(s) for reporting: HYPERV2016
      [INFO]    - 17.May.2018 09:06:51 - Gathering Hyper-V Host information...
      [INFO]    - 17.May.2018 09:07:03 - Gathering Virtual Machine information...
  • getting this error on windows 2016
    2 Posts | Last post May 16, 2018
    • Getting Error  HYPERV2016: Incompatible operating system version detected. Supported operating systems are Windows Server 2012 and Windows Server 2012 R2.
      
      I have already tried 
      
      Line 838 and Line 1261
      
      1st i Try this
      
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*"))
      
      2nd I Try this
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "*")) 
      
      3rd I ty this
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*") -or ($OsVersion -like "*"))
      
    • If you are Running 2016 Hyper-v Cluster the you have to produce changes 
      
      Open Script on Notepad ++
      
      Line 838, 1173 and 1261 Produce the below changes. 
      
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*") -or ($OsVersion -like "*"))
  • getting this error on windows 2016
    1 Posts | Last post May 16, 2018
    • Getting Error  HYPERV2016: Incompatible operating system version detected. Supported operating systems are Windows Server 2012 and Windows Server 2012 R2.
      
      I have already tried 
      
      Line 838 and Line 1261
      
      1st i Try this
      
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*"))
      
      2nd I Try this
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "*")) 
      
      3rd I ty this
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*") -or ($OsVersion -like "*"))
      
  • Export to PDF
    1 Posts | Last post May 07, 2018
    • Hi,
      
      Many thanks for this, would be great to get the report in PDF, how can we easily achieve this?
      
  • VM with Shared VHDX enabled
    1 Posts | Last post April 23, 2018
    • Hello,
      
      I think that your script don't care about shared VHD.
      
      On my cluster I've 4 Vm that shared 10 VHD (This VHD can growth to 2.5 Tb). The dashboard report that the CSV here are the shared VHD can get over 10 TB. Sou I think that the script accumulate the information to this shared VHD 4 times.
      
      Can you check please?
  • Customizing add VM Description
    1 Posts | Last post April 11, 2018
    • Hi everyone,
      
      I'd like to customize the script for my needs. We do not have replication in our cluster, therefore I would like to change the replication column to VM's description. So I added following lines in line 1866 of the script:
         if ($VM.Description)
                  {
                      $outVMDescription = $VM.Description
                  }
                  else
                  {
                      $outVMDescription = "No Description"
                  }
      So what I get when running this, is always "No Description". $VM.Description has no value. I tried Debugging this for a while now, however I have no clue what may be wrong. 
      
      Any experienced powershell user out there who might give me a clue ?
        
  • getting this error on windows 2016
    3 Posts | Last post April 04, 2018
    • I modified the ps1 file adding if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*")) and i am getting Imcompatible operating systems version detcted. 
      
    • Same here, did You fix it ?
    • i change
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "10.0*"))
      
      to
      if (($OsVersion -like "6.2*") -or ($OsVersion -like "6.3*") -or ($OsVersion -like "*"))
      
      Its working. 
11 - 20 of 101 Items