VMware Cloud Community
vmscox
Contributor
Contributor

Script to pull settings from VM's

I am curious if anyone has made a script that would produce a report with all the settings for all the VM's in a cluster/host, etc.  I would need every setting (datastore (full path) VM hardware version, CPU, memory, etc.) needed to recreate a new VM but point it back to the original VM's disks).  I would prefer the report to be in CSV format.  Is there anything like this out there?

Thank you for any help.

Sean

0 Kudos
7 Replies
vin01
Expert
Expert

YYou can try this one..

Complete VM information

Regards Vineeth.K
0 Kudos
vmscox
Contributor
Contributor

Looks good so far, how do I get this into a CSV?

0 Kudos
MCioe
Enthusiast
Enthusiast

Look up export-csv

from Microsoft Tech Net:

Using the Export-Csv Cmdlet 

0 Kudos
vmscox
Contributor
Contributor

I'm familiar with the command but given how this script is written and displays the output I'm not sure where to add it to get all the data or even if I could use it in this script.

0 Kudos
vin01
Expert
Expert

‌save the script in .ps1 format..try as below

for example vminfo.ps1

execute like this

vminfo.ps1 |export-csv -path 'c:\vminformat.csv' -notypeinformation -noclobber

Regards Vineeth.K
0 Kudos
75109
Contributor
Contributor

Why not use rvtools. It will pull that plus all kinds of other useful information. It will come out in excel or csv and it's free.

You can run it as a scheduled task and have it email you.

robware.net

0 Kudos
MCioe
Enthusiast
Enthusiast

You could also look at how to export a hash table to export-csv. There are some solutions out there.

Hashtable export-csv format output - PowerShell.com – PowerShell Scripts, Tips, Forums, and Resource...

0 Kudos