Dear All,
I'm looking for power cli script to get complete inventory like below format.
VM | Power Stat | Allocated CPU | Allocated RAM | No of Disk | Disk Size | Disk State (thin or think) | Snapshot | Host | Data Store | OS
Can you please help please ..
Thanks
Siva
you can replace desired path with c:\result.csv, This CSV file can be opened in excel file
Get-VM | Select-Object Name, Powerstate, NumCPU, MemoryGB, @{N="Noofdisk"; E={($_ | Get-HardDisk).count}}, HardDisks, @{N="Datastore"; E={($_ | Get-Datastore).Name}}, @{N="DiskState"; E={($_ | Get-HardDisk).storageformat}}, ProvisionedSpaceGB, @{N="Snapshot"; E={($_ | Get-snapshot).count}}, VMHost, @{N="OS"; E={$_.ExtensionData.summary.config.guestfullname}} | export-csv -notypeinformation -path c:\result.csv
Get-VM | Select-Object Name, Powerstate, NumCPU, MemoryGB, @{N="Noofdisk"; E={($_ | Get-HardDisk).count}}, HardDisks, @{N="Datastore"; E={($_ | Get-Datastore).Name}}, @{N="DiskState"; E={($_ | Get-HardDisk).storageformat}}, ProvisionedSpaceGB, @{N="Snapshot"; E={($_ | Get-snapshot).count}}, VMHost, @{N="OS"; E={$_.ExtensionData.summary.config.guestfullname}}
Check out this script on blog, you will may find all required info.
http://kunaludapi.blogspot.in/2013/12/extended-vm-inventory-using-powercli.html#.U51N-LEW1bg
Dear kunaludapi,
Already gone through the link. Anyway thanks for sharing.
I'm getting output in same screen. i want out put in excel so that i can filter and use
Because same script i need to run more than 35 VC to get the inventory.
Any idea to get the complete output in excel ?
you can replace desired path with c:\result.csv, This CSV file can be opened in excel file
Get-VM | Select-Object Name, Powerstate, NumCPU, MemoryGB, @{N="Noofdisk"; E={($_ | Get-HardDisk).count}}, HardDisks, @{N="Datastore"; E={($_ | Get-Datastore).Name}}, @{N="DiskState"; E={($_ | Get-HardDisk).storageformat}}, ProvisionedSpaceGB, @{N="Snapshot"; E={($_ | Get-snapshot).count}}, VMHost, @{N="OS"; E={$_.ExtensionData.summary.config.guestfullname}} | export-csv -notypeinformation -path c:\result.csv
Awesome , Worked great , how could we include Datacenter and how could we add SMTP , i need an output in email.