VMware Cloud Community
afhamsani
Enthusiast
Enthusiast
Jump to solution

Invoke multiple vcenters from rvtoolsbatch

Hi guys,

Can you please help how i can be possible called upon multiple vCenters from rvtoolsbatch and will send all it all as different attachment but in a single mail?

From what i read on rvtools documentation, it was suggesting to use a colon as a separator, but i couldnt get like what i want to have and Keep getting error Unhandled exception: Invalid URI: The hostname could not be parsed.

I can write multiple lines to invoke multiple vcenters and send email or attachment likewise, but that would beat a purpose as i wanted to have all rvtools report of all vcenters in a single email.

Please help.

Cheers

43 Replies
system_noida
Enthusiast
Enthusiast
Jump to solution

Hi LucD,

The script is working for me too. but I need the file name along with date name, like RVTool_Report_vCenter01_18-03-22 and also I want to generate a new file each time I run this script. please could you help me with this.

Tags (1)
Reply
0 Kudos
anil_linux
Contributor
Contributor
Jump to solution

tried for multiple vc to run with powercli script ran but no output

Reply
0 Kudos
ATOS-ALLSCRIPTS
Contributor
Contributor
Jump to solution

Hi Team,

I am using rvtools version 4.4.5  with vcenter 7.0u3n as below scripit and not able to generate and also no error . any help appriciate

$ExportPath = 'C:\Temp\Rvtools'

 

 

$Servers = 'vCenter1,vCenter2'

 

 

$Servers | %{

 

 

. "C:\Program Files (x86)\Robware\RVTools\RVTools.exe" –u Root1 –p _RVToolsPWDRHyqpGAHn3n0d3xGrJzoQrIsq423hxzs= -s "$($_)" -c ExportAll2xls -d "$($ExportPath)" -f "RVTools-$($_)-$(Get-Date -f 'yyyyMMdd').xlsx"

 

 

}

 

 

$smtpServer = 'smtp.testdev.com'

 

 

$to = ''

 

 

$from = ''

 

 

start-sleep -s 100

 

 

$att = Get-ChildItem -Path $ExportPath -Filter RVTools*.xlsx | select -ExpandProperty FullName

 

 

 

Send-MailMessage -SmtpServer $smtpServer -Subject 'RVTools reports' -To $to -From $from -Attachments $att

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You do know your $to variable is empty?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos