Code: Select all
$session = New-PSSession -Configurationname Microsoft.Exchange -ConnectionURI http://PRDMAIL01-VM/PowerShell/ -Authentication Kerberos
[void] (Import-PSSession $session -AllowClobber)
$ExcServers = (Get-TransportService)
$ExcServers | ForEach-Object {Get-Queue -Server $_.Server} |
Where-Object {($_.MessageCount -gt 0) -and ($_.Identity -notlike "*\Poison") -and ($_.Identity -notlike"*\Shadow\*")} |
Select-Object Identity, Status, MessageCount, NextHopDomain, LastError | ft -AutoSize
If possible, how can the result is emailed?
Thanks in advance.