I saved the following simple script to a PS1 file using Notepad, and then setup
a scheduled task that repeats every 5 min.
Get-TransportServer | Get-Queue | Where {$_.MessageCount -gt 10 -and
$_.deliverytype -notlike "*shadow*"} > c:\temp\EarlyQueue_States.txt
If ((get-item c:\temp\EarlyQueue_States.txt).length -gt 0){Send-MailMessage
-From <<Your Sender address>> -To <<Your Recipient address>> -Subject
"Transport Queue Alert" -Priority High -Attachments
c:\temp\EarlyQueue_States.txt -SmtpServer <<your Hub server>>}
Keith D. Beahm | Messaging and Storage Architect | Stinson Leonard Street LLP
1201 Walnut Street, Suite 2900 | Kansas City, MO 64106-2150
T: 816.691.3374 | M: 816.808.8983 | F: 816.412.1022
[email protected] | http://www.stinson.com
This communication (including any attachments) is from a law firm and may
contain confidential and/or privileged information. If it has been sent to you
in error, please contact the sender for instructions concerning return or
destruction, and do not use or disclose the contents to others.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Liby Philip Mathew
Sent: Sunday, November 01, 2015 1:52 AM
To: [email protected]
Subject: [powershell] Exchange 2010 PowerShell script to notify the mail server
queue and schedule to run in every 30min
Hi,
I have an Exchange 2010 SP3 environment. I am looking for a good script that
will notify the admin if there are mails stuck in the queue above a certain
count say 10 mails.
A consolidated script that scans all HT is preferable. If not, individual
script that run on each HT will be fine.
I am also looking for the same for Edge serves.
I am sure there are many experts who may have done this in their environment.
Appreciate any input.
TIA.
Regards
Mathew
Disclaimer
[The information contained in this e-mail message and any attached files are
intended solely for the use of the individual or entity to whom they are
addressed. This transmission may contain information that is confidential, Path
Solutions Private, or exempt from disclosure under applicable law and/or Path
Solutions information security policy. The receiver of this communication shall
not transmit any part of this message unless the email subject clearly classify
it as “Public” or a written permission has been given by the information assets
owner. If you have received this e-mail in error, please notify the sender
immediately and delete all copies, any disclosure, copying, distribution, or
use of the information contained herein is STRICTLY PROHIBITED. Path Solutions
accepts no responsibility for any errors, omissions, computer viruses and other
defects.]
P Protect our planet: Do not print this email unless necessary.
================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1
tify the sender immediately and delete all copies, any disclosure, copying,
distribution, or use of the information contained herein is STRICTLY
PROHIBITED. Path Solutions accepts no responsibility for any errors, omissions,
computer viruses and other defects.]
P Protect our planet: Do not print this email unless necessary.
============
================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1