Hi
I have the following script below which reports on disk space for Exchange DAGS and send it in an email, at the moment its a bit messy and creates 3 lists. What I would like to do is put all the information into 1 table rather then 3 lists, is this possible?
$servernames = @('GRPMBX1001','GRPMBX1002') $smtpsettings = @{ To = David@Email.com From = ExchangeStats@Email.com Subject = Exchange Server Space Report for $((Get-Date).ToShortDateString()) SmtpServer = SMTPRELAY.Email.com } $Message1 = Get-WmiObject -computer $servernames win32_volume|where-object {$_.caption -ne $null -and $_.label -ne System Reserved -and $_.drivetype -eq 3}|select-object __SERVER,Name, @{Name="Capacity(GB)";expression={[math]::round(($_.Capacity/ 1073741824),2)}}, @{Name="FreeSpace(GB)";expression={[math]::round(($_.FreeSpace / 1073741824),2)}}, @{Name="Free(%)";expression={[math]::round(((($_.FreeSpace / 1073741824)/($_.Capacity / 1073741824)) * 100),0)}} | sort name | convertto-html $Message2 = get-MailboxDatabase -Status dag01* | select name,@{Name="InUse";Expression={$_.DatabaseSize- $_.AvailableNewMailboxSpace}} | select name,@{L='DAG Size';E={$_.InUse.toGB()}} | sort name | convertto-html $message3 = Get-MailboxDatabaseCopyStatus * | select name, status | sort name | ConvertTo-Html Send-MailMessage @smtpsettings -Body "$Message1 $Message2 $Message3" -BodyAsHTML