Hi folks,
i have a simple PowerShell inventory script for our ESXi servers and i would like to integrate two additional items:
License type (Standard, Enterprise, Enterprise Plus)
License expiration date.
Does anybody have an advice how to obtain this information with my script below?
The script looks like follows:
Get-View -ViewType HostSystem |
select Name,
@{N='Cluster';E={
$parent = Get-View -Id $_.Parent -Property Name,Parent
While ($parent -isnot [VMware.Vim.ClusterComputeResource] -and $parent.Parent){
$parent = Get-View -Id $parent.Parent -Property Name,Parent
}
if($parent -is [VMware.Vim.ClusterComputeResource]){
$parent.Name}}},
@{N="Type";E={$_.Hardware.SystemInfo.Vendor+ " " + $_.Hardware.SystemInfo.Model}},
@{N="BIOS version"; E={$_.Hardware.BiosInfo.BiosVersion}},
@{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}},
@{N='Product';E={$_.Config.Product.FullName}},
@{N='Build';E={$_.Config.Product.Build}}| export-csv -NoTypeInformation -Path C:\temp\report_esxihosts.csv
The script's output so far is a CSV with hostname, cluster, hardware & BIOS information, product name and build number.
I am not sure whether i can retrieve the addional information with the "Get-View" pipe as well or if i have to build an entirely new loop statement for this ( i am a PowerShell newbie, i must admit).
Thanks in advance!
Karsten