VMware Cloud Community
Sivapb
Enthusiast
Enthusiast
Jump to solution

Complete Inventory

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

1 Solution

Accepted Solutions
kunaludapi
Expert
Expert
Jump to solution

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

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".

View solution in original post

4 Replies
kunaludapi
Expert
Expert
Jump to solution

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

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
Sivapb
Enthusiast
Enthusiast
Jump to solution

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 ?

0 Kudos
kunaludapi
Expert
Expert
Jump to solution

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

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
Achilies
Contributor
Contributor
Jump to solution

Awesome , Worked great , how could we include Datacenter and how could we add SMTP , i need an output in email.

0 Kudos