Logo faq-o-matic.net
Logo faq-o-matic.net

Get-HyperVInventory: New Download Source is Here

von veröffentlicht am23. Dezember 2020, 06:50 Uhr Kurzlink und Zitatlink einblenden
Kategorie Kategorie: Community, English, PowerShell, Scripting, Virtualisierung, Windows Server   Translate with Google Translate Translate EN   Die angezeigte Seite drucken

Some weeks ago, Microsoft have announced that they are going to shut down their TechNet Gallery very soon (that is: at the end of December, 2020). There is a small number of contributions that we have been involved with. Furtunately, the original license (MIT license) allows us to republish those contributions. So in the next days we are going to do this.

This contribution was first published in Microsoft’s TechNet Gallery. See the authors and copyright notices in the text below.

Get-HyperVInventory: Create inventory reports of Hyper-V environments

Overview

Get-HyperVInventory.ps1 is a PowerShell script to create documentation reports (HTML or plain text) of single Hyper-V host servers (including client Hyper-V on Windows 8 and later) or complete Hyper-V failover clusters.

Get-HyperVInventory reads configuration data from Hyper-V host servers and writes them to an HTML file or a plain text file in a structured way. It is designed to be an inventory and reporting tool. It does not include performance or health data.

The script does not change anything on the systems. It only reads data and writes a text file. Thus, it is not „harmful“ by itself. It may, however, create significant load on your host servers if you run it in a very large environment.

The reports may include confidential data. So you should make sure to handle the reports adequately.

The script has multiple operation modes that let you choose between a a full cluster inventory (including all host servers and all VMs), an inventory of just one host server (local or remote, including or excluding all VMs), a cluster core inventory or VM inventories.

This is only a small compilation of the data the script gathers:

  • Hyper-V failover clusters: cluster core data, cluster networks, cluster storage
  • Hyper-V host servers: OS details, CPUs (and cores), RAM, host networking, virtual switches, replication
  • VMs: general data, CPU, RAM, networking, disks, Integration Services, replication

See a sample report with the following link (mind: this is only the sample report, not the tool itself!)

Download: Hyper-V-Inventory-Sample Cluster Report  Hyper-V-Inventory-Sample Cluster Report (177,9 KiB, 2.037-mal heruntergeladen, letzte Änderung am 22. Dezember 2020)

A screenshot of the menu

clip_image001

Download

Download the script here:

Download: Get-HyperVInventory v2.4  Get-HyperVInventory v2.4 (320,2 KiB, 29.688-mal heruntergeladen, letzte Änderung am 22. Dezember 2020)

New in version 2.4

The new version:

  • includes more data, especially for Windows Server 2016: Shielded VMs, VM Groups, Checkpoint type and some more
  • still runs with Windows Server 2012, 2012 R2 and 2016 – and with the client versions Windows 8, 8.1 and 10
  • includes Virtual Fibre Channel basic data (thanks to Sascha Loth)
  • includes the companion script Get-HyperVInventory-MultipleReports.ps1 to create separate reports automatically (since v 2.3)
  • tells you „what’s new“ in the README.txt file
  • ships with an optional signed version so you can be sure it is the original script

Platforms

This script has been developed and tested on Windows Server 2012 R2 and Windows Server 2016.

You need:

  • OS: Windows Server 2012, Windows Server 2012 R2 or Windows Server 2016, any edition capable of Hyper-V (slightly limited functionality in Windows Server 2012)
    for client Hyper-V: Windows 8, Windows 8.1 or Windows 10 with Hyper-V enabled
  • PowerShell 3.0 or higher (default in Windows Server 2012, v4.0 in 2012 R2)
  • Hyper-V role installed and configured
  • optional: Failover cluster role installed and configured
  • Run the script in a PowerShell session with elevated privileges. Your account needs Administrator privileges on each host to report on.
  • a folder to store the report (default: current user’s Documents folder, but you can specify any folder)

Attention

This script has not been designed for very large environments. It has not yet been tested in large environments, either.

As the script may create significant load (especially when there are many hosts in a cluster) please make sure that its execution will not harm your production environment. You can always run the script in one of the partial report modes to test it or to gather data from individual hosts. This should not have much impact on the respective server.

But keep in mind that you need to run the script with Administrator privileges so make sure that the script has not been modified by an attacker. You can report remote hosts but you must launch the script on a Hyper-V enabled computer.

The script has not been fully tested with a restricted user account. It may run and it may not.

Neither the author nor the company can provide any warranty for the script. Use at your own risk.

Usage

  • Set your PowerShell Execution Policy to „RemoteSigned“ at least. Depending on where your copy is stored you might need to set it to „Unrestricted“.
    Example: ‚Set-ExecutionPolicy RemoteSigned‘
  • Run the script like this in the powershell commandshell or PowerShell ISE:
    .\Get-HyperVInventory.ps1 [[-output] <String>] [[-mode] <String>] [[-format] <String>] [[-noview] <Boolean>] [[-remoteHost] <String>] [[-VMName] <String>] [<CommonParameters>]
  • Make sure to launch your PowerShell window or PowerShell ISE as Administrator.
  • You can launch the script without parameters, it will then ask for the mode to perform.
  • Run the script locally on a Hyper-V host server (or on one of the cluster hosts of the cluster you want to document) even if you want to document a different host.

Full online help and a readme file are included. A sample report is included as well.

Simple Reporting: If you need multiple reports that cover the cluster level, each host and each VM separately, use the companion script Get-HyperVInventory-MultipleReports.ps1. Make sure the script is stored in the same folder as Get-HyperVInventory.ps1 on one of your Hyper-V hosts, and launch it with administrator privileges. No parameters. The script then scans your environment and creates one HTML report per item (cluster, host, vm).

New (v2.4 and higher): There are two versions of the script. The one with the label „signed“ in its name is cryptographically signed by the main author so you can be sure it is the correct one. Rename it if you want to use it. This is optional, you can of course use the smaller unsigned version.

Future versions

The script will be further developed. We are planning:

  • Improvements to the report for better readability
  • Selected additional data

Authors

The script has been authored by Christopher Junker, Sascha Loth and Nils Kaczenski. The project was initiated by the german IT service company Michael Wessel Informationstechnologie GmbH in Hannover.

Was: <https://gallery.technet.microsoft.com/Get-HyperVInventory-Create-2c368c50/description>

© 2005-2023 bei faq-o-matic.net. Alle Rechte an den Texten liegen bei deren Autorinnen und Autoren.

Jede Wiederveröffentlichung der Texte oder von Auszügen daraus - egal ob kommerziell oder nicht - bedarf der ausdrücklichen Genehmigung durch die jeweiligen Urheberinnen oder Urheber.

Das Impressum findet sich unter: http://www.faq-o-matic.net/impressum/

Danke, dass du faq-o-matic.net nutzt. Du hast ein einfaches Blog sehr glücklich gemacht!