An RVTools-style inventory tool for Hyper-V. One script collects every VM, disk, network adapter, checkpoint, switch, replication setting, and integration service across one or more Hyper-V hosts, then exports the result to a colour-coded Excel workbook, a self-contained HTML report, or CSV files.
please visit https://m365admintools.com/hyperv-inventory for more information and more tools.
Built for IT administrators and MSPs who need a full picture of a Hyper-V environment for documentation, capacity planning, an audit, or a migration assessment.
VMware administrators have RVTools. Hyper-V administrators have Hyper-V Manager, which shows one host at a time and cannot export. This script fills that gap. It is read-only, it changes nothing in the environment, and it produces a file you can send to a client, attach to a change request, or keep as as-built documentation.
| Item | Requirement |
|---|---|
| PowerShell | 5.1 or later |
| Hyper-V module | Hyper-V role, or RSAT-Hyper-V-Tools on a management workstation |
| Excel output | The ImportExcel module. Optional. Without it the script skips Excel and still writes HTML and CSV |
| Permissions | Local Administrator on each Hyper-V host. Run the console as Administrator for full CPU and memory detail |
| Remote hosts | WinRM enabled and reachable on each host |
Install the optional Excel module:
Install-Module ImportExcel -Scope CurrentUser# Local host, all three output formats
.\HyperV-Inventory.ps1
# Several hosts
.\HyperV-Inventory.ps1 -ComputerName HV01,HV02,HV03
# HTML only, written to a specific folder
.\HyperV-Inventory.ps1 -OutputFormat HTML -OutputPath C:\Reports
# Remote hosts with alternate credentials
.\HyperV-Inventory.ps1 -ComputerName HV01,HV02 -Credential (Get-Credential)If the script is blocked on first run:
Unblock-File .\HyperV-Inventory.ps1| Parameter | Type | Default | Description |
|---|---|---|---|
-ComputerName |
string[] | Local computer | One or more Hyper-V host names |
-OutputPath |
string | Script directory | Folder for output files. Created if it does not exist |
-OutputFormat |
string | All |
Excel, HTML, CSV, or All |
-Credential |
PSCredential | Current user | Credentials for remote hosts. See Known limitations |
| Section | Contents |
|---|---|
| Dashboard | Totals for VMs, running and off counts, vCPUs, assigned RAM, disk used, disks, adapters, checkpoints, switches, and replicated VMs |
| vInfo | VM name, state, status, generation, vCPU count, CPU usage, assigned, startup, minimum, maximum and demanded memory, dynamic memory setting, uptime, integration services version, guest OS, notes, paths, checkpoint type, automatic start and stop actions, VM ID, creation date |
| vDisk | Controller type, number and location, disk path, VHD type and format, file size, current size, fragmentation, block and sector sizes, attached state, parent path |
| vNetwork | Adapter name, switch name, MAC address, dynamic MAC setting, IP addresses, VLAN ID and mode, connection status, bandwidth minimum and maximum, device ID |
| vSnapshot | Checkpoint name, type, creation time, parent, notes, vCPU count, assigned RAM, ID |
| vHost | Manufacturer, model, OS and build, CPU sockets and logical processors, CPU name, total and free RAM, default VM and VHD paths, live migration settings, NUMA spanning, enhanced session mode, uptime |
| vSwitch | Switch name, type, bound network adapter, notes, management OS sharing, bandwidth reservation mode, extensions |
| vReplication | Replication state, health, mode, replica and primary server, authentication type, compression, last replication time, frequency, recovery points, VSS snapshot frequency |
| vIntegration | Integration service name, enabled state, primary and secondary status, interface name, per VM |
All files are timestamped, so repeat runs never overwrite each other.
HyperV-Inventory_20260917_142233.xlsx
HyperV-Inventory_20260917_142233.html
HyperV-Inventory_20260917_142233_vInfo.csv
HyperV-Inventory_20260917_142233_vDisk.csv
... one CSV per section
Excel. One worksheet per section plus a Dashboard tab, with frozen header rows, auto-filters, sized columns, and colour coding:
- VM state: green for running, red for off, amber for any other state
- Disk file size: green under 100 GB, amber 100 to 500 GB, red at 500 GB and above
- VHD type: amber for dynamic disks
- Replication health: coloured by reported health
HTML. A single self-contained file with tabbed sections, a filter box per table, and click-to-sort column headers. No internet connection or external files required, so it can be emailed as one attachment.
CSV. One file per section. Written automatically if neither Excel nor HTML output is available.
------------------------------------------------------------
Inventory Summary
------------------------------------------------------------
Hosts inventoried : 3
Total VMs : 47
Running : 41
Off : 5
Other : 1
Total vCPUs : 128
Total RAM (GB) : 612.00
Total Disk (GB) : 8442.19
Total vDisks : 63
Total vNICs : 52
Total Snapshots : 9
Virtual Switches : 6
Replicated VMs : 12
[Excel] C:\Reports\HyperV-Inventory_20260917_142233.xlsx
[HTML] C:\Reports\HyperV-Inventory_20260917_142233.html
Hyper-V PowerShell module not found. Install RSAT-Hyper-V-Tools or the Hyper-V role.
The script stops here because it cannot continue without the module. On a Hyper-V host the role includes it. On a management workstation:
# Windows Server
Install-WindowsFeature RSAT-Hyper-V-Tools
# Windows 10 and 11
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShellImportExcel not found. Excel output skipped.
A warning, not an error. HTML and CSV still run. Install the module with Install-Module ImportExcel -Scope CurrentUser to enable the workbook.
Could not collect host info from HV01
The host was not reachable over WinRM or CIM. Test both:
Test-WSMan -ComputerName HV01
Get-CimInstance Win32_OperatingSystem -ComputerName HV01If WinRM is not configured on the target, run Enable-PSRemoting -Force on that host.
WinRM cannot process the request. The following error with errorcode 0x8009030e occurred
No credentials were available for the remote host. This appears when the host is in a different domain or a workgroup. Supply -Credential and confirm the account is a local Administrator on the target.
Get-VHD : The system failed to open the file
The disk file is on storage the running account cannot read, commonly an SMB share holding the VHDX files. Run the script as an account with read access to that share. The VM row is still collected, with the disk detail columns empty.
Some columns are empty for certain VMs
Expected in several cases. Guest OS, IP addresses, and memory demand come from integration services, so they return nothing for a VM that is off or has integration services disabled. Replication columns are empty unless the VM is replicated.
The script is very slow on a large environment
Collection is per VM, so the runtime grows with VM count. Get-VHD is the slowest call because it opens every disk file. Use -OutputFormat CSV to skip Excel styling on very large environments.
-Credentialis applied to host-level queries and the VM list. The per VM queries for disks, adapters, checkpoints, replication, and integration services run as the calling account. On hosts in another domain or a workgroup this can produce partial data. Run the script from an account with access to the target hosts.- The script is read-only. It does not change any setting, start or stop any VM, or delete any checkpoint.
- Hyper-V clusters are not enumerated automatically. Pass the node names to
-ComputerName.
- Free Microsoft 365, Active Directory, and Veeam tools at m365admintools.com
Charles Arconi, m365admintools.com
MIT. See LICENSE.