hi guys,
found a script by lucd for this output but struggling to make it output to e-mail,
basically just a formatted table via email listing the pool name, number of virtual desktops per pool
email using smtp to whomever.
thanks,
travis
You could do something like this.
It assumes that $table is an array with the data you want to send.
With the ConvertTo-Html you can go fancy and apply style sheets.
PS: I used splatting for the parameters
$sMail = @{
To = 'me@domain.com'
From = 'you@domain.com'
Subject = 'Report'
SmtpServer = 'smtp.domain.com'
BodyAsHtml = $true
Body = $table | ConvertTo-Html | Out-String
}
Send-MailMessage @sMail
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You could do something like this.
It assumes that $table is an array with the data you want to send.
With the ConvertTo-Html you can go fancy and apply style sheets.
PS: I used splatting for the parameters
$sMail = @{
To = 'me@domain.com'
From = 'you@domain.com'
Subject = 'Report'
SmtpServer = 'smtp.domain.com'
BodyAsHtml = $true
Body = $table | ConvertTo-Html | Out-String
}
Send-MailMessage @sMail
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference