Hi Guys, i would expect to see the $Greater string published in the sent mail here, however i does not appear
####Import Shell $SESJA_EX = New-PSSession -ConnectionUri http://eurxhub02/powershell -ConfigurationName microsoft.exchange Import-PSSession $SESJA_EX ###Get Detail $greater50CPY = Get-MailboxDatabaseCopyStatus -Server eurxmbs03 | Select mailboxserver, name, replayqueuelength, COPYqueuelength, status | where {$_.copyqueuelength -ge 0} $greater50RPLY = Get-MailboxDatabaseCopyStatus -Server eurxmbs03 | Select mailboxserver, name, replayqueuelength, COPYqueuelength, status | where {$_.replayqueuelength -ge 0} $greater = $greater50CPY + $greater50RPLY ##Variables $smtpServer = "smtp.xxx.com" $From = "XMBS-Alerts@xxx.com" $Email = "mark.prior@xxx.com" $Subject = "EURXMBS03 Message Queues" $Body = "$Greater" #Email Content if $greater50 contains a value if ($greater50CPY) {Send-Mailmessage -smtpServer $smtpServer -from $from -to $Email -subject $subject -priority High -Body $body} if ($greater50RPLY) {Send-Mailmessage -smtpServer $smtpServer -from $from -to $Email -subject $subject -priority High -Body $body}