So I needed to automatically run an oversized VM report on a few vRops environments and combine them into one report.

This isn’t my full script as I take the csv and combine is with other data from other metadata, database..etc… but hopefully the following example script / function might help you… It executes the report via the suite-api, waits for it to finish and downloads the csv to a local folder.

First things first… update line 15 in the example script below with your own vRops server IP or FQDN.

So that I don’t keep being prompted for credentials I save the service account user and password with the powershell Get-Credential command.

Once you have generated the XML update line 16 to reflect your *.XML file

 

Now that we got that out of the way… we need to obtain the ResourceID for the object / level we wish to run the report for, in my case i want to run it for the whole VC so the easiest way to find the ResourceID for the VC is to use the vRops GUI, search for the VC and get the ResourceID from the URL.

VC-ResourceID

Go to line 17 in the code below and update it to match your ResourceID

Now we need to do something similar for the Report that the script will run… So in the vRops GUI, navigate to Content, Reports, Click on Generated Reports

vROps-Oversize-Report

Once you click on Generated Reports you will notice that the URL now has an ID for the Report

vROps-Oversize-Report_1

Go to line 18 in the code below and update it to match the Report ID

 

if you found this post useful please consider checking out one of the sponsored links to keep the site running…

full script below…