简体   繁体   English

如何获取交换电子邮件队列的通知

[英]How to get notification of exchange email queue

i want to get the notification of full details of get-queue when my exchange queue reaches maximum message count , here is what i have now which give you the details but not in correct format. 当我的交换队列达到最大邮件数时,我想获取有关get-queue的完整详细信息的通知,这是我现在拥有的内容,它为您提供详细信息,但格式不正确。

function check_queue
{
$a = get-queue | measure-object MessageCount -max
$b = Get-Queue | Out-File -filepath C:\getQueue.txt

if ($a.Maximum -gt 1000)
{
send_email $a.Maximum
}
}

function send_email
{param ($queue_size)

$emailFrom = "exchange@xyz.com"
$emailTo = "test@xyz.com"
$subject = "Exchange Max Mail QUEUE"
$body = Get-Queue | Out-String
$smtpServer = "mail.xyz.com"
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($emailFrom, $emailTo, $subject, $body)

}

check_queue

here is the output which is not clear in the format when i get the notification:- 这是我收到通知时格式不清楚的输出:-

Identi DeliveryType Status MessageCount Velocity RiskLevel OutboundIPPool NextH
ty                                                                        opDom
                                                                          ain  
------ ------------ ------ ------------ -------- --------- -------------- -----
xy... SmtpDeliv... Ready  0            0        Normal    0              ma...
xy... SmtpDeliv... Ready  0            0        Normal    0              ma...
xy... SmtpDeliv... Ready  0            0        Normal    0              ma...
xy... SmtpDeliv... Ready  0            0        Normal    0              ma...
xy... SmtpRelay... Ready  0            0        Normal    0              ed...
xy... Undefined    Ready  0            0        Normal    0              Su...
xy... ShadowRed... Ready  20           0        Normal    0              gr...

If you want to have all details of the object in your output file, you might use the format cmdlets. 如果要在输出文件中包含对象的所有详细信息,则可以使用cmdlet格式。 eg format-custom, format-list $body = get-queue | format-list | out-string 例如format-custom,format-list $body = get-queue | format-list | out-string $body = get-queue | format-list | out-string

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 powershell cmdlet 在 prem 上获取 Exchange 服务器的电子邮件正文 - how to get email body for exchange server on prem using powershell cmdlet PowerShell获取用户的电子邮件地址进行交换 - PowerShell Get Users Email Address To Exchange 如何获取给定 Exchange 邮箱的唯一发件人电子邮件地址列表(和计数) - How do I get a list of unique sender-email addresses (and the count) for a given Exchange mailbox 如何排队电子邮件命令,直到连接到网络 - How to queue an email command until connected to a network 如何检查使用Powershell在Exchange 2010中是否已阅读电子邮件? - How to check if an email was read in Exchange 2010 using powershell? 如何在exchange 2010数据库中获取邮箱大小 - how to get mailbox size in exchange 2010 database 如何在PowerShell Exchange中获取GroupMailboxes的成员 - How to get Members of GroupMailboxes in PowerShell Exchange Exchange mgmt Shell:从公共文件夹中的所有邮件获取发件人电子邮件地址 - Exchange mgmt shell: get sender email adress fron all mail in public folder 如何获取用户有权访问Exchange2010的所有共享邮箱的列表| 是Exchange命令行管理程序还是PowerShell? - How to get a list of all the Shared Mailboxes that a user have access to Exchange2010 | Exchange Management Shell or PowerShell? 如何通过Exchange Server 2013每天发送的电子邮件数量 - How to get number of emails sent daily via Exchange Server 2013
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM