Nutanix VM Inventory Script using powershell
3 min read
Archive notice (October 2026): This post is from 2017 and is kept for reference only. The script relies on the legacy NutanixCmdletsPSSnapin, which only runs in Windows PowerShell 5.1, and Nutanix deprecates its legacy v0.8, v1, v2 and v3 APIs starting with the AOS and Prism Central release planned for Q4-CY2027. Don’t run it against a current cluster. For a current inventory of your Nutanix environment, use the Nutanix Documentation Script v5.0.

Last week Magnus Andersson posted a Nutanix AHV VM Reporting script which leverages the internal commandline options to export some basic VM configuration to an excel file. In the same week our team got a question about how to do this based on powershell.
When I combined those two I took on the challenge and wrote a few lines of powershell to collect similar information and drop it into CSV.
The script will collect the following information:
- VM Name
- Container (which storage container the primary boot disk is stored on)
- Protection Domains
- Host Placement
- Power State
- The number of network adapters
- IP addresses
- The number of vCPUs
- The amount of vRAM assigned to the VM (GB)
- Disk count
- Provisioned space (GB)
- Used space (GB)
Running the script is pretty straightforward, make sure you have the powershell cmdlets installed (Go to Prism, select Admin and click on “Download Cmdlets installer”). This script was tested with the cmdlets in AOS5. Once the cmdlets are installed you can run the following command line:
.\Nutanix_VM_Inventory_v1.ps1 -nxIP "99.99.99.99.99" -nxUser "admin"
This will provide you with a CSV file stored on your desktop called “NutanixVMInventory.csv”:
The script itself:
<#
.SYNOPSIS
Creates a complete inventory of a Nutanix environment.
.DESCRIPTION
Creates a complete inventory of a Nutanix Cluster configuration using CSV and PowerShell.
.PARAMETER nxIP
IP address of the Nutanix node you're making a connection too.
.PARAMETER nxUser
Username for the connection to the Nutanix node
.PARAMETER nxPassword
Password for the connection to the Nutanix node
.EXAMPLE
PS C:\PSScript > .\nutanix_inventory.ps1 -nxIP "99.99.99.99.99" -nxUser "admin"
.INPUTS
None. You cannot pipe objects to this script.
.OUTPUTS
No objects are output from this script.
This script creates a CSV file.
.NOTES
NAME: Nutanix_Inventory_Script_v1.ps1
VERSION: 1.0
AUTHOR: Kees Baggerman with help from Andrew Morgan
LASTEDIT: February 2017
#>
# Setting parameters for the connection
[CmdletBinding(SupportsShouldProcess = $False, ConfirmImpact = "None") ]
Param(
# Nutanix cluster IP address
[Parameter(Mandatory = $true)]
[Alias('IP')] [string] $nxIP,
# Nutanix cluster username
[Parameter(Mandatory = $true)]
[Alias('User')] [string] $nxUser,
# Nutanix cluster password
[Parameter(Mandatory = $true)]
[Alias('Password')] [Security.SecureString] $nxPassword
)
# Adding PS cmdlets
$loadedsnapins=(Get-PSSnapin -Registered | select name).name
if(!($loadedsnapins.Contains("NutanixCmdletsPSSnapin"))){
Add-PSSnapin -Name NutanixCmdletsPSSnapin
}
# Connecting to the Nutanix Cluster
$nxServerObj = Connect-NTNXCluster -Server $nxIP -UserName $nxUser -Password $nxPassword -AcceptInvalidSSLCerts
# Fetching data and putting into CSV
$vms = @(get-ntnxvm)
$FullReport=@()
foreach ($vm in $vms){
$usedspace=0
if(!($vm.nutanixvirtualdiskuuids.count -le 0)){
foreach($UUID in $VM.nutanixVirtualDiskUuids){
$usedspace+=(Get-NTNXVirtualDiskStat -Id $UUID -Metrics controller_user_bytes).values[0]
}
}
if ($usedspace -gt 0){
$usedspace=[math]::round($usedspace /1gb,0)
}
$container= "NA"
if(!($vm.vdiskFilePaths.count -le 0)){
$container = $vm.vdiskFilePaths[0].split('/')[1]
}
$props=[ordered]@{
"VM Name" = $vm.vmName
"Container" = $container
"Protection Domain" = $vm.protectionDomainName
"Host Placement" = $vm.hostName
"Power State" = $vm.powerstate
"Network adapters" = $vm.numNetworkAdapters
"IP Address(es)" = $vm.ipAddresses -join ","
"vCPUs" = $vm.numVCpus
"vRAM (GB)" = [math]::round($vm.memoryCapacityInBytes / 1GB,0)
"Disk Count" = $vm.nutanixVirtualDiskUuids.count
"Provisioned Space (GB)" = [math]::round($vm.diskCapacityInBytes / 1GB,0)
"Used Space (GB)" = $usedspace
} #End properties
$Reportobject= New-Object PSObject -Property $props
$fullreport+=$Reportobject
}
$fullreport | Export-Csv -Path ~\Desktop\NutanixVMInventory.csv -NoTypeInformation -UseCulture
# Disconnecting from the Nutanix Cluster
Disconnect-NTNXCluster -Servers *
A thank you goes out to Andrew Morgan for being ever so patient and answering my questions!
Kees Baggerman
Latest posts by Kees Baggerman (see all)
- Cloud Desktop Density: Where the Maths Breaks Down - November 5, 2026
- Egress Is the Second Lock-In: Modeling the Real Cost of Leaving Your Cloud Provider - November 4, 2026
- Stop Renting Their VM Layer: The Case for Hybrid Multicloud Infrastructure - October 28, 2026
- The Cloud Desktop CPU Lottery, AMD Edition: Which Zen Are You Actually Running On? - October 23, 2026
- Citrix MCSIO on Nutanix AHV: A Solution to a Problem That Doesn’t Exist - June 10, 2026



Is it possible to add functionality to get this list in email?
I’m running AOS 5.1.4 and i don’t seem to be able to location the cmdlets for 5.1.4 i have 5.1.2 any help locating the correct cmdlets would be awesome!!
You can download them from your cluster, go to Prism, click on Admin and Download Cmdlets.
Hi, is there a way to list VM by Date of creation?