Powershell Exchange Message Per Day Sent and Reveive

# Initialize some variables used for counting and for output
Get-Date -UFormat "%Y-%m-%d-%H-%M" >>Per-day_recive.txt $Account="wendychen"
[Int64] $intSent = $intRec = 0
[Int64] $intSentSize = $intRecSize = 0
[String] $strEmails = $null $times=Import-CSV "d:\LOGTime.csv"
foreach ($time in $times)
{
# Start building the variable that will hold the information for the day
$starttime=$time.starttime
$endtime=$time.endtime
echo $starttime $endtime ssss
$intSent = $intRec = 0
(Get-TransportServer -Identity wendy-*) | Get-MessageTrackingLog -ResultSize Unlimited -Recipients "$Account" -Start "$starttime" -End "$endtime" | ForEach {
# Sent E-mail
If ($_.EventId -eq "RECEIVE" -and $_.Source -eq "STOREDRIVER")
{
$intSent++
$intSentSize += $_.TotalBytes
} # Received E-mails
If ($_.EventId -eq "DELIVER")
{
$intRec++
$intRecSize += $_.TotalBytes
}
} $intSentSize = [Math]::Round($intSentSize/1MB, 0)
$intRecSize = [Math]::Round($intRecSize/1MB, 0) $DataBase = Get-Mailbox -Identity $Account |Get-MailboxStatistics Write-Host "$Account,`nintSentSize=$intSentSize,`nReciveSize=$intRecSize" -ForegroundColor Yellow
$DataBase.DisplayName,$DataBase.DataBaseName,$starttime,$endtime,$intRecSize,$intSentSize -join ";">>d:\"$Account"-Per-day_recive.csv }

Powershell Exchange Message Per Day Sent and Reveive的更多相关文章

  1. Powershell Exchange Server UP Time

    Server up time Get-ExchangeServer | where{$_.name -like'wendy*'} | %{ if(Test-Connection $_.name -Co ...

  2. Powershell检查邮件队列设置阈值,通过html形式进行邮件告警

    为了完善公司的整体邮件质量,博主通过zabbix监控了exchange的所有微软推荐项目,并写了很多powershell来辅佐, 旨在更大程度上提高整体的邮件性能 这篇文章主要是讲通过powershe ...

  3. Exchange 2013 、Lync 2013、SharePoint 2013 三

    前两篇介绍的是关于Exchange 与 Lync 之间的配制关系,这一篇介绍关于Lync.Exchange 与 SharePoint 之间建立信任关系. 首先要创建基于SSL的SharePoint A ...

  4. amqp 和 exchange 详细解释

    amqp  的 excange 字面意思是一个交换机.他的任务是吧 消息 分配给消息队列. amqp 的  exchange 有三种,分别是 Direct , fanout 和 toppic.三种. ...

  5. 消息中间件——RabbitMQ(六)理解Exchange交换机核心概念!

    前言 来了解RabbitMQ一个重要的概念:Exchange交换机 1. Exchange概念 Exchange:接收消息,并根据路由键转发消息所绑定的队列. 蓝色框:客户端发送消息至交换机,通过路由 ...

  6. RabbitMQ(Exchange交换机详解)(四)

    Exchange:接收消息,并根据路由键转发消息所绑定的队列 ClientA,B将消息投递到交换机Exchange上,通过路由关系,投递到指定的queue1或者queue2上,通过监听投递到Clien ...

  7. Microsoft Win32 to Microsoft .NET Framework API Map

    Microsoft Win32 to Microsoft .NET Framework API Map .NET Development (General) Technical Articles   ...

  8. SSL握手步骤【收藏】

    http://www.codeweblog.com/ssl-handshake-process-of-interaction-and/ SSL to send a message in the fol ...

  9. ssl 握手过程【收藏】

    收藏几篇关于ssl handshake的好文 http://www.slashroot.in/comment/1242 SSL protocol, does its fantastic job of ...

随机推荐

  1. Android Studio 新手常见错误:Gradle DSL method not found: 'runProguard()'

    在Android Studio上执行Github上的某Android开源项目,提示报错: Error:(20, 0) Gradle DSL method not found: 'runProguard ...

  2. C# 中字符串string和字节数组byte[]的转换

    string转byte[]: byte[] byteArray = System.Text.Encoding.Default.GetBytes ( str ); byte[]转string: stri ...

  3. Lintcode---统计比给定整数小的数的个数

    给定一个整数数组 (下标由 0 到 n-1,其中 n 表示数组的规模,数值范围由 0 到 10000),以及一个 查询列表.对于每一个查询,将会给你一个整数,请你返回该数组中小于给定整数的元素的数量. ...

  4. Current thread must be set to single thread apartment (STA) mode before OLE,当前线程不在单线程单元中,因此无法实例化 ActiveX 控件“8856f961-340a-11d0-a96b-00c04fd705a2”。

    Add the STAThreadAttribute attribute on the Main method. This attribute is required if your program ...

  5. 修改System.Web.Mvc.WebViewPage创建自己的pageBase

    <system.web.webPages.razor> <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, ...

  6. maven打包classes为jar

    <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-p ...

  7. sourceInsight设置

    复制后光标定格在行尾 Options -> Preferences -> Typing -> After pasting,select:at end of pasted text t ...

  8. linux学习笔记18---目录结构

    对于每一个Linux学习者来说,了解Linux文件系统的目录结构,是学好Linux的至关重要的一步.,深入了解linux文件目录结构的标准和每个目录的详细功能,对于我们用好linux系统至关重要,下面 ...

  9. (译)Getting Started——1.1.1 Start Developing IOS Today(开始IOS开发)

    安装       本课程对于创建运行在iPad.iPhone和iPod触摸屏上的应用来说,是一个完美的起点.该向导的四个板块可以作为构建你第一个应用的简单向导——内容包括了你需要使用的工具,主要的理念 ...

  10. javascript存储器属性与数据属性

    在新的js规范中,我们又多了几种定义属性的方法.给一个对象添加属性,以前可能是这样的 var o = {name: '未起名';} 现在可以这样子 var o = {get name(){return ...