<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Exchange Server Pro &#187; Tutorials</title>
	<atom:link href="http://exchangeserverpro.com/category/tutorials/feed" rel="self" type="application/rss+xml" />
	<link>http://exchangeserverpro.com</link>
	<description>Microsoft Exchange Server News - Tips - Tutorials</description>
	<lastBuildDate>Mon, 21 May 2012 12:51:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to Prevent Meeting Requests Appearing in Delegate&#8217;s Outlook Calendars</title>
		<link>http://exchangeserverpro.com/how-to-prevent-meeting-requests-appearing-in-delegates-outlook-calendars</link>
		<comments>http://exchangeserverpro.com/how-to-prevent-meeting-requests-appearing-in-delegates-outlook-calendars#comments</comments>
		<pubDate>Mon, 21 May 2012 12:51:39 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Delegates]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Meeting Requests]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4835</guid>
		<description><![CDATA[How to create new Outlook meeting requests as a delegate so that they are sent on behalf of the manager and do not appear in the delegate's own calendar.]]></description>
			<content:encoded><![CDATA[<p>In the article on <a href="http://exchangeserverpro.com/exchange-server-2010-room-mailboxes-step-by-step-guide">Exchange 2010 Room Mailboxes</a> a reader <a href="http://exchangeserverpro.com/exchange-server-2010-room-mailboxes-step-by-step-guide#comment-6877">asks</a>:</p>
<blockquote><p>Do you know if there is a way to stop accepted meeting room resource requests going into the meeting organiser’s calendar? This is because the PA’s request the meeting rooms on behalf of their bosses but they aren’t going to attend the meeting themselves.</p></blockquote>
<p>The solution to this problem is in how the meeting request is created.</p>
<p>If the delegate opens a new meeting request for themselves and adds their manager and other attendees to it, then the delegate will also be include as the meeting organizer.</p>
<div id="attachment_4836" class="wp-caption aligncenter" style="width: 421px"><img class="size-full wp-image-4836" title="Meeting request sent by the delegate as the meeting organizer" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/delegates01.jpg" alt="Meeting request sent by the delegate as the meeting organizer" width="411" height="282" /><p class="wp-caption-text">Meeting request sent by the delegate as the meeting organizer</p></div>
<p>Instead, if the delegate starts the new meeting request by first opening their manager&#8217;s calendar and selecting a block of time, the meeting request will be on behalf of the manager, and will not go into the delegate&#8217;s calendar.</p>
<div id="attachment_4837" class="wp-caption aligncenter" style="width: 404px"><img class="size-full wp-image-4837" title="Meeting request sent by delegate on behalf of their manager" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/delegates02.jpg" alt="Meeting request sent by delegate on behalf of their manager" width="394" height="274" /><p class="wp-caption-text">Meeting request sent by delegate on behalf of their manager</p></div>
<p>Depending on the delegate settings the manager has configured the delegate can then receive all of the meeting responses from attendees and room mailboxes.</p>
<p><img class="aligncenter size-full wp-image-4838" title="delegates03" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/delegates03.jpg" alt="" width="423" height="332" /></p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/error-outlook-unable-recover-items-folder" title="Error: Outlook Was Unable to Recover Some or All of the Items in this Folder">Error: Outlook Was Unable to Recover Some or All of the Items in this Folder</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-block-non-cached-mode-outlook" title="How to Block Non-Cached Mode Outlook Clients with Exchange 2010">How to Block Non-Cached Mode Outlook Clients with Exchange 2010</a></li><li><a href="http://exchangeserverpro.com/outlook-error-delegates-settings-saved-correctly" title="Outlook Error: The Delegates Settings Were Not Saved Correctly">Outlook Error: The Delegates Settings Were Not Saved Correctly</a></li><li><a href="http://exchangeserverpro.com/update-rollup-3-exchange-2010-sp1-exchange-2007-sp3" title="Update Rollup 3 for Exchange 2010 SP1 and Exchange 2007 SP3">Update Rollup 3 for Exchange 2010 SP1 and Exchange 2007 SP3</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-restricting-room-mailbox-bookings-to-specific-groups" title="Restricting Room Mailbox Bookings to Specific Groups in Exchange Server 2010">Restricting Room Mailbox Bookings to Specific Groups in Exchange Server 2010</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/how-to-prevent-meeting-requests-appearing-in-delegates-outlook-calendars">How to Prevent Meeting Requests Appearing in Delegate&#8217;s Outlook Calendars</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/how-to-prevent-meeting-requests-appearing-in-delegates-outlook-calendars/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restricting Room Mailbox Bookings to Specific Groups in Exchange Server 2010</title>
		<link>http://exchangeserverpro.com/exchange-2010-restricting-room-mailbox-bookings-to-specific-groups</link>
		<comments>http://exchangeserverpro.com/exchange-2010-restricting-room-mailbox-bookings-to-specific-groups#comments</comments>
		<pubDate>Mon, 21 May 2012 12:24:31 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Room Mailboxes]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4828</guid>
		<description><![CDATA[How to restrict the booking of a Room Mailbox to only specific users or groups in Exchange Server 2010.]]></description>
			<content:encoded><![CDATA[<p>In the comments of the <a href="http://exchangeserverpro.com/exchange-server-2010-room-mailboxes-step-by-step-guide">Exchange 2010 Room Mailboxes</a> article a reader <a href="http://exchangeserverpro.com/exchange-server-2010-room-mailboxes-step-by-step-guide#comment-6919">asks</a>:</p>
<blockquote><p>I was wondering, is there anyway to make only a specific group being able to book a specific conference room? We have mailboxes set up and is working perfectly, but we want only one specific section/unit to be able to book that conference room, is that possible?</p></blockquote>
<p>Yes, this can be configured on room mailboxes quite easily.</p>
<p>In the <strong>Properties</strong> of the room mailbox go to the <strong>Resource In-Policy Requests</strong> tab and configure selected recipients who are permitted to book the room.</p>
<p><img class="aligncenter size-full wp-image-4829" title="room-mailbox-limiting-bookings" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/room-mailbox-limiting-bookings.jpg" alt="" width="444" height="299" /></p>
<p>When a person who is not a in that selected recipients list tries to book the room they will receive a &#8220;Declined&#8221; message similar to this.</p>
<p><img class="aligncenter size-full wp-image-4830" title="declined" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/declined.jpg" alt="" width="432" height="269" /></p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/show-full-freebusy-exchange-2010-room-resource-mailboxes" title="Show Full Free/Busy Details for Exchange Server 2010 Room and Resource Mailboxes">Show Full Free/Busy Details for Exchange Server 2010 Room and Resource Mailboxes</a></li><li><a href="http://exchangeserverpro.com/find-meeting-rooms" title="How to Find Available Meeting Rooms">How to Find Available Meeting Rooms</a></li><li><a href="http://exchangeserverpro.com/exchange-server-2010-room-mailboxes-step-by-step-guide" title="Exchange Server 2010 Room Mailboxes Step by Step Guide">Exchange Server 2010 Room Mailboxes Step by Step Guide</a></li><li><a href="http://exchangeserverpro.com/how-to-prevent-meeting-requests-appearing-in-delegates-outlook-calendars" title="How to Prevent Meeting Requests Appearing in Delegate&#8217;s Outlook Calendars">How to Prevent Meeting Requests Appearing in Delegate&#8217;s Outlook Calendars</a></li><li><a href="http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs" title="Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs">Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/exchange-2010-restricting-room-mailbox-bookings-to-specific-groups">Restricting Room Mailbox Bookings to Specific Groups in Exchange Server 2010</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/exchange-2010-restricting-room-mailbox-bookings-to-specific-groups/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs</title>
		<link>http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs</link>
		<comments>http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs#comments</comments>
		<pubDate>Thu, 10 May 2012 11:00:14 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Log Parser]]></category>
		<category><![CDATA[Protocol Logs]]></category>
		<category><![CDATA[SMTP]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4808</guid>
		<description><![CDATA[How to generate a report of the number of SMTP errors occurring on an Exchange server using Log Parser and the Exchange protocol logs.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://exchangeserverpro.com">Exchange Server 2010</a> protocol logs can reveal some interesting information to you about the number of SMTP errors that are occurring for connections to or from your server.</p>
<p>This information is useful for scenarios such as checking whether your outbound mail may experiencing a high rate of failure, or discovering whether someone is continually trying to relay through your email server (in which case you could then look at the <a href="http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser">top sender IP addresses</a> to investigate further).</p>
<p>Remember that protocol logging is not enabled by default on Exchange 2010, and must be enabled on a per-connector basis if you want to use it.</p>
<p>For SMTP error statistics we can use Log Parser to check the protocol logs for instances of <a href="http://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xml">SMTP status codes</a> starting with &#8220;5&#8243; (which are permanent failures). The Log Parser query for this is as follows:</p>
<pre>SELECT data as [Status Code],
	Count(*) as Hits
FROM *.log
WHERE data LIKE '5%'
GROUP BY data
ORDER BY Hits DESC</pre>
<p>When run from the folder containing the protocol logs it will be as follows:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT data as [Status Code],Count(*) as Hits FROM *.log WHERE data LIKE '5%' GROUP BY data ORDER BY Hits DESC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>This will give you output similar to this:</p>
<pre>Status Code                                       Hits
------------------------------------------------- ----
500 5.3.3 Unrecognized command                    3632
501 5.1.3 Invalid address                         1411
501 5.1.7 Invalid address                         200
554 5.4.6 Hop count exceeded - possible mail loop 100
503 5.5.2 Send hello first                        20
503 5.5.2 Sender already specified                4
501 5.5.4 Unrecognized parameter                  2
504 5.7.4 Unrecognized authentication type        1

Statistics:
-----------
Elements processed: 13113294
Elements output:    8
Execution time:     150.15 seconds (00:02:30.15)</pre>
<p>You can also report on the number of SMTP errors occurring each day to get a baseline, which will help when you need to identify whether a sudden spike in SMTP errors has occurred. This Log Parser query will be as follows:</p>
<pre>SELECT TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING([#Fields: date-time]),0,'T'), 'yyyy-MM-dd')) AS Date,
	COUNT(*) AS Hits
FROM *.log
WHERE (data LIKE '5%')
GROUP BY Date
ORDER BY Date ASC</pre>
<p>When run from the protocol log directory it will be as follows:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING([#Fields: date-time]),0,'T'), 'yyyy-MM-dd')) AS Date, COUNT(*) AS Hits from *.log where (data LIKE '5%') GROUP BY Date ORDER BY Date ASC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>And of course, provided you have the Office Web Components installed, you can generate a graph of this same data.</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING([#Fields: date-time]),0,'T'), 'yyyy-MM-dd')) AS Date, COUNT(*) AS [SMTP Errors] INTO DailySMTPErrors.gif from *.log where (data LIKE '5%') GROUP BY Date ORDER BY Date ASC" -i:CSV -nSkipLines:4 -chartType:Column3D</pre>
<p>Which will give you a graph similar to this:</p>
<p><img class="aligncenter size-full wp-image-4809" title="DailySMTPErrors" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/DailySMTPErrors.gif" alt="" width="590" height="442" /></p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser" title="Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser">Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser</a></li><li><a href="http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser" title="Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser">Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser" title="Calculate Daily Email Traffic using Message Tracking Logs and Log Parser">Calculate Daily Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser" title="Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser">Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell" title="Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell">Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs">Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser</title>
		<link>http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser</link>
		<comments>http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser#comments</comments>
		<pubDate>Wed, 09 May 2012 11:00:56 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Edge Transport]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Hub Transport]]></category>
		<category><![CDATA[Log Parser]]></category>
		<category><![CDATA[Message Tracking]]></category>
		<category><![CDATA[Protocol Logs]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4802</guid>
		<description><![CDATA[How to use Log Parser, message tracking and protocol logs to report the top sender IPs for an Exchange 2010 Hub or Edge Transport server.]]></description>
			<content:encoded><![CDATA[<p>When you are investigating <a href="http://exchangeserverpro.com">Exchange</a> Transport server load one of the interesting pieces of data to look at is the IP addresses that are connecting to your server the most.</p>
<p>There are two different log sets that you can use for this:</p>
<ul>
<li>Protocol logs</li>
<li>Message Tracking logs</li>
</ul>
<p>One of the best ways to describe the difference between these is that protocol logs will capture SMTP connections that may or may not make it all the way in to the Transport pipeline. For example a connection from a spammer that gets blocked by <a href="http://exchangeserverpro.com/exchange-2010-edge-transport-server-configuring-ip-block-list-providers">IP filtering</a> will appear in the protocol logs but not the message tracking logs.</p>
<p>The detail captured in a protocol log will look a lot like what you would see if you were manually <a href="http://exchangeserverpro.com/how-to-send-email-via-telnet">testing SMTP via telnet</a> on a server.</p>
<p><a href="http://exchangeserverpro.com/exchange-2010-message-tracking">Message tracking logs</a> will capture messages that get processed through the Transport pipeline, and capture information such as message submission and delivery rather than the SMTP conversation that protocol logging reflects.</p>
<p>Message tracking is also turned on by default and is set per-server, whereas protocol logging is not turned on by default and is set per-connector.</p>
<p>For this demonstration I&#8217;ll be using my <a href="http://exchangeserverpro.com/exchange-2010-edge-transport-server-introduction">Edge Transport server</a> simply because it has slightly more interesting data since it receives a lot of connections from the internet.</p>
<h2>Get Top Sender IP&#8217;s from Protocol Logs with Log Parser</h2>
<p>To get the top sender IP&#8217;s from the protocol logs we can use this Log Parser query.</p>
<pre>SELECT EXTRACT_PREFIX(remote-endpoint,0,':') as IP,
	REVERSEDNS(EXTRACT_PREFIX(remote-endpoint,0,':')) as Name,
	Count(*) as Hits
FROM *.log
WHERE data LIKE '%EHLO%'
GROUP BY IP
ORDER BY Hits DESC</pre>
<p>When run from the folder containing the protocol logs (in this case C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpReceive) it looks like this:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT EXTRACT_PREFIX(remote-endpoint,0,':') as IP,REVERSEDNS(EXTRACT_PREFIX(remote-endpoint,0,':')) as Name,Count(*) as Hits from *.log WHERE data LIKE '%EHLO%' GROUP BY IP ORDER BY Hits DESC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>This will give you output similar to this:</p>
<pre>IP              Name                                    Hits
--------------- --------------------------------------- ----
83.222.31.220   v8622.vps.masterhost.ru                 52
204.13.248.72   mho-02-ewr.mailhop.org                  12
50.78.250.97    dcmail.designercabinetry.com            9
10.1.1.21       ho-ex2010-mb1.exchangeserverpro.net     8
64.61.92.26     static-64-61-92-26.isp.broadviewnet.net 7
217.108.179.228 mailhost.el-internationale.com          7
69.60.118.117   mail1.ambr.com.br                       4
10.1.1.22       ho-ex2010-mb2.exchangeserverpro.net     4
95.154.196.147  95.154.196.147                          4
118.22.2.202    pc2.land-ho-unet.ocn.ne.jp              3
187.108.193.223 cloud.newmediahost.com.br               2
109.169.77.169  109.169.77.169                          2
59.106.64.208   ns1.uranaikan.info                      2
204.13.248.71   mho-01-ewr.mailhop.org                  2
78.129.222.16   78.129.222.16                           2
199.119.76.15   mail.seoauditions.com                   1

Statistics:
-----------
Elements processed: 3359
Elements output:    16
Execution time:     17.41 seconds</pre>
<p>This part of the query string is important to note:</p>
<pre>WHERE data LIKE '%EHLO%'</pre>
<p>This means that only those log entries where the EHLO occurred will be counted in the stats that Log Parser outputs. If you leave it out you&#8217;ll see a &#8220;Hit&#8221; for every log entry a remote IP generated. Depending on how &#8220;chatty&#8221; that particular SMTP conversation was it may skew the results a little. However since we&#8217;re looking more for indicative numbers rather than precise numbers it doesn&#8217;t matter which way you choose to go (at least not to me).</p>
<h2>Get Top Sender IP&#8217;s from Message Tracking Logs with Log Parser</h2>
<p>For message tracking logs the syntax is a little different because the field names in the log files are different.</p>
<pre>SELECT client-ip as IP,
	REVERSEDNS(client-ip) as Name,
	Count(*) as Hits
FROM *.log
WHERE (event-id='RECEIVE')
GROUP BY IP
ORDER BY Hits DESC</pre>
<p>When run from the folder containing the message tracking logs (in this case C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\MessageTracking) it will look like this:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT client-ip as IP,REVERSEDNS(client-ip) as Name,Count(*) as Hits from *.log WHERE (event-id='RECEIVE') GROUP BY IP ORDER BY Hits DESC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>If you get too much output you can limit it to the top X results by modifying the query slightly:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT TOP 20 client-ip as IP,REVERSEDNS(client-ip) as Name,Count(*) as Hits from *.log WHERE (event-id='RECEIVE') GROUP BY IP ORDER BY Hits DESC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>This will give you output similar to this:</p>
<pre>IP              Name                                 Hits
--------------- ------------------------------------ ----
204.93.210.179  mariajunco.com                       32
10.1.1.22       ho-ex2010-mb2.exchangeserverpro.net  23
216.151.172.180 hosted.airvm.net                     22
10.1.1.21       ho-ex2010-mb1.exchangeserverpro.net  22
83.142.48.139   83.142.48.139                        17
67.215.235.199  67.215.235.199.static.quadranet.com  13
109.169.76.124  109.169.76.124                       10
109.169.55.146  109.169.55.146                       10
109.169.62.15   109.169.62.15                        10
109.169.60.137  109.169.60.137                       9
173.254.208.113 173.254.208.113.static.quadranet.com 9
59.106.64.208   ns1.uranaikan.info                   8
72.11.150.131   72.11.150.131.static.quadranet.com   7
109.169.73.116  109.169.73.116                       7
109.169.55.135  109.169.55.135                       7
189.39.9.214    mail3.ibcbrasil.com.br               5
204.13.248.72   mho-02-ewr.mailhop.org               5
109.169.87.100  109.169.87.100                       4
109.169.84.105  109.169.84.105                       4
169.232.46.177  out-58.smtp.ucla.edu                 3

Statistics:
-----------
Elements processed: 1018
Elements output:    20
Execution time:     74.03 seconds (00:01:14.03)</pre>
<p>You can use this information in a lot of situations such as when investigating load issues, or planning to decommission servers</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs" title="Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs">Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs</a></li><li><a href="http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser" title="Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser">Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser" title="Calculate Daily Email Traffic using Message Tracking Logs and Log Parser">Calculate Daily Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser" title="Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser">Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2007-2010-infinite-loops-internal-relay-domains" title="Avoiding Infinite Loops with Internal Relay Domains in Exchange 2007/2010">Avoiding Infinite Loops with Internal Relay Domains in Exchange 2007/2010</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser">Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Managing the Replication Source for Exchange Server 2010 Mailbox Database Reseed</title>
		<link>http://exchangeserverpro.com/managing-the-replication-source-for-exchange-server-2010-mailbox-database-reseed</link>
		<comments>http://exchangeserverpro.com/managing-the-replication-source-for-exchange-server-2010-mailbox-database-reseed#comments</comments>
		<pubDate>Wed, 02 May 2012 13:48:56 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DAG]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Mailbox Server]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4777</guid>
		<description><![CDATA[How to choose the optimal source server for an Exchange Server 2010 mailbox database reseed operation.]]></description>
			<content:encoded><![CDATA[<p>In some Exchange Server 2010 environments the administrator may encounter a situation in which mailbox databases need to be reseeded from a single server in one site to multiple servers in another site.</p>
<p>Consider a scenario where the mailbox database is active in a site with a single mailbox server, and has passive copies in a site with two mailbox servers. The two mailbox servers hosting passive copies need reseeding due to some fault that has occurred.</p>
<div id="attachment_4778" class="wp-caption aligncenter" style="width: 600px"><img class="size-full wp-image-4778" title="Exchange Server 2010 multi-site DAG" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/exchange-2010-dag-reseed-1.jpg" alt="Exchange Server 2010 multi-site DAG" width="590" height="250" /><p class="wp-caption-text">Exchange Server 2010 multi-site DAG</p></div>
<p>If the reseed was commenced for both servers it would effectively mean the data was replicated across the WAN twice, which may not be ideal depending on the available bandwidth.</p>
<div id="attachment_4780" class="wp-caption aligncenter" style="width: 600px"><img class="size-full wp-image-4780" title="Exchange 2010 database reseed from active copy" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/exchange-2010-dag-reseed-21.jpg" alt="Exchange 2010 database reseed from active copy" width="590" height="250" /><p class="wp-caption-text">Exchange 2010 database reseed from active copy</p></div>
<p>This is because by default the database copy update operation uses the active copy of the database as the source. This would be the case if you ran the <a href="http://technet.microsoft.com/en-us/library/dd335201.aspx">Update-MailboxDatabaseCopy</a> cmdlet with only the mandatory parameters.</p>
<p>However if you use the console wizard to perform the operation you&#8217;ll notice an option to choose the source for the reseed.</p>
<div id="attachment_4781" class="wp-caption aligncenter" style="width: 491px"><img class="size-full wp-image-4781" title="Choosing a database reseed source in Exchange 2010" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/exchange-2010-dag-reseed-4.jpg" alt="Choosing a database reseed source in Exchange 2010" width="481" height="227" /><p class="wp-caption-text">Choosing a database reseed source in Exchange 2010</p></div>
<p>This allows you to perform the reseed more efficiently in terms of network bandwidth by reseeding one server first, and then using that passive copy as the source for the second reseed operation.</p>
<div id="attachment_4783" class="wp-caption aligncenter" style="width: 600px"><img class="size-full wp-image-4783" title="Exchange 2010 DAG reseed from passive copy" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/exchange-2010-dag-reseed-31.jpg" alt="Exchange 2010 DAG reseed from passive copy" width="590" height="250" /><p class="wp-caption-text">Exchange 2010 DAG reseed from passive copy</p></div>
<p>This can also be performed using Update-MailboxDatabaseCopy with the <strong>-SourceServer</strong> parameter, for example:</p>
<pre>Update-MailboxDatabaseCopy MB-HO-01\br-ex2010-mb -SourceServer ho-ex2010-mb2</pre>
<p>An alternative would be to reseed one server first, then move the active mailbox database copy to that server before commencing the second database reseed in that site.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/how-to-install-updates-on-exchange-server-2010-database-availability-groups" title="How to Install Updates on Exchange Server 2010 Database Availability Groups">How to Install Updates on Exchange Server 2010 Database Availability Groups</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-passive-database-copies-included-backups-dag-members" title="Exchange 2010: Are Passive Database Copies Included in Backups of DAG Members?">Exchange 2010: Are Passive Database Copies Included in Backups of DAG Members?</a></li><li><a href="http://exchangeserverpro.com/exchange-recovery-failed-dag-member-exchange-server-2010" title="Exchange Recovery: Failed DAG Member in Exchange Server 2010">Exchange Recovery: Failed DAG Member in Exchange Server 2010</a></li><li><a href="http://exchangeserverpro.com/how-to-reseed-a-failed-mailbox-database-copy-in-exchange-server-2010" title="How to Reseed a Failed Mailbox Database Copy in Exchange Server 2010">How to Reseed a Failed Mailbox Database Copy in Exchange Server 2010</a></li><li><a href="http://exchangeserverpro.com/exchange-server-2010-database-availability-group-installation-step-by-step" title="Exchange Server 2010 Database Availability Group Installation Step by Step">Exchange Server 2010 Database Availability Group Installation Step by Step</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/managing-the-replication-source-for-exchange-server-2010-mailbox-database-reseed">Managing the Replication Source for Exchange Server 2010 Mailbox Database Reseed</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/managing-the-replication-source-for-exchange-server-2010-mailbox-database-reseed/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser</title>
		<link>http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser</link>
		<comments>http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser#comments</comments>
		<pubDate>Wed, 02 May 2012 11:47:30 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Log Parser]]></category>
		<category><![CDATA[Message Tracking]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4762</guid>
		<description><![CDATA[How to use Log Parser to generate an hourly email traffic report from the Exchange Server message tracking logs.]]></description>
			<content:encoded><![CDATA[<p>Most <a href="http://exchangeserverpro.com">Exchange server </a>environments will demonstrate a predictable volume of email traffic throughout a typical day. However from time to time some problem may arise that causes an unusual spike in email traffic.</p>
<p>To be able to identify this type of problem you should first know what your normal email traffic patterns look like. You can find this information by using <a href="http://technet.microsoft.com/en-us/scriptcenter/dd919274">Log Parser</a> to search through your Exchange server&#8217;s <a href="http://exchangeserverpro.com/exchange-2010-message-tracking">message tracking logs</a>.</p>
<p>There are two ways to look at this traffic.</p>
<ul>
<li>As a total of the traffic per hour for all days combined</li>
<li>As the traffic per hour for each separate day</li>
</ul>
<h2>Total Email Traffic Per Hour for All Days Combined</h2>
<p>First let&#8217;s look at the Log Parser query to calculate the total email traffic per hour for all days combined.</p>
<pre>SELECT QUANTIZE(TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING(EXTRACT_SUFFIX([#Fields: date-time],0,'T')),0,'.'), 'hh:mm:ss')),3600) AS Hour,
	COUNT(*) AS Messages
FROM *.log
WHERE (event-id='RECEIVE')
GROUP BY Hour
ORDER BY Hour ASC</pre>
<p>When run from the folder where the message tracking logs are located the full syntax is:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT QUANTIZE(TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING(EXTRACT_SUFFIX([#Fields: date-time],0,'T')),0,'.'), 'hh:mm:ss')),3600) AS Hour, COUNT(*) AS Messages from *.log where (event-id='RECEIVE') GROUP BY Hour ORDER BY Hour ASC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>This will return results similar to these:</p>
<pre>Hour     Messages
-------- --------
00:00:00 408
01:00:00 415
02:00:00 363
03:00:00 347
04:00:00 273
05:00:00 327
06:00:00 403
07:00:00 450
08:00:00 590
09:00:00 574
10:00:00 637
11:00:00 810
12:00:00 612
13:00:00 597
14:00:00 700
15:00:00 789
16:00:00 821
17:00:00 448
18:00:00 396
19:00:00 527
20:00:00 346
21:00:00 476
22:00:00 348
23:00:00 448

Statistics:
-----------
Elements processed: 106823
Elements output:    24
Execution time:     0.58 seconds</pre>
<p>You can also generate graphs straight from Log Parser (if you have the required Office Web Components installed) with slightly different syntax like this:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT QUANTIZE(TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING(EXTRACT_SUFFIX([#Fields: date-time],0,'T')),0,'.'), 'hh:mm:ss')),3600) AS Hour, COUNT(*) AS [Messages per Hour] INTO HourlyTraffic.gif from *.log where (event-id='RECEIVE') GROUP BY Hour ORDER BY Hour ASC" -i:CSV -nSkipLines:4 -chartType:Column3D</pre>
<p>That Log Parser query will generate a column graph for you similar to this.</p>
<p><img class="aligncenter size-full wp-image-4766" title="Hourly Traffic Graph via Log Parser" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/HourlyTraffic1.gif" alt="" /></p>
<h2>Total Email Traffic Per Hour for Each Separate Day</h2>
<p>If you&#8217;d rather see the hourly traffic for each separate day you can use the following Log Parser query that handles the timestamps slightly differently.</p>
<pre>SELECT TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(TO_STRING(EXTRACT_PREFIX([#Fields: date-time],0,'.')), 'yyyy-MM-ddThh:mm:ss'),3600)) AS Hour,
	COUNT(*) AS Messages
FROM *.log
WHERE event-id='RECEIVE'
GROUP BY Hour
ORDER BY Hour ASC</pre>
<p>The full Log Parser command when run from the folder containing the message tracking logs is as follows:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(TO_STRING(EXTRACT_PREFIX([#Fields: date-time],0,'.')), 'yyyy-MM-ddThh:mm:ss'),3600)) AS Hour, COUNT(*) AS Messages from *.log where event-id='RECEIVE' GROUP BY Hour ORDER BY Hour ASC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>This will generate a lot of output depending on the amount of log retention you have configured.</p>
<pre>Hour                Messages
------------------- --------
2012-04-05 10:00:00 48
2012-04-05 11:00:00 77
2012-04-05 12:00:00 35
2012-04-05 13:00:00 74
2012-04-05 14:00:00 84
2012-04-05 15:00:00 86
2012-04-05 16:00:00 79
2012-04-05 17:00:00 35
2012-04-05 18:00:00 44
2012-04-05 19:00:00 24
2012-04-05 20:00:00 41
2012-04-05 21:00:00 19
2012-04-05 22:00:00 40
2012-04-05 23:00:00 59
2012-04-06 00:00:00 28
2012-04-06 01:00:00 42
2012-04-06 02:00:00 22
2012-04-06 03:00:00 31
2012-04-06 04:00:00 16
2012-04-06 05:00:00 31
2012-04-06 06:00:00 40
2012-04-06 07:00:00 22
2012-04-06 08:00:00 84
2012-04-06 09:00:00 77
2012-04-06 10:00:00 46
2012-04-06 11:00:00 84
....</pre>
<p>As with other Log Parser results you can output this one to a graph as well (again, providing that you have the Office Web Components installed).</p>
<p>Because of the amount of data a line graph seems more appropriate than a column graph. The default size of a graph generated by Log Parser is 640&#215;480, but you can use the <strong>-groupsize</strong> parameter to set a custom <strong>width x height</strong> that suits the amount of data being included.</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(TO_STRING(EXTRACT_PREFIX([#Fields: date-time],0,'.')), 'yyyy-MM-ddThh:mm:ss'),3600)) AS Hour, COUNT(*) AS Messages INTO DailyTrafficPerHour.gif from *.log where event-id='RECEIVE' GROUP BY Hour ORDER BY Hour ASC" -i:CSV -nSkipLines:4 -chartType:Line -groupsize:1024x480</pre>
<p>&nbsp;</p>
<p><img class="aligncenter size-large wp-image-4786" title="DailyTrafficPerHour2" src="http://exchangeserverpro.com/wp-content/uploads/2012/05/DailyTrafficPerHour2-600x281.gif" alt="" width="600" height="281" /></p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser" title="Calculate Daily Email Traffic using Message Tracking Logs and Log Parser">Calculate Daily Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser" title="Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser">Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser</a></li><li><a href="http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs" title="Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs">Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser" title="Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser">Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell" title="Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell">Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser">Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How to Set Up an Automated Exchange 2010 Database Backup Alert Email</title>
		<link>http://exchangeserverpro.com/set-automated-exchange-2010-database-backup-alert-email</link>
		<comments>http://exchangeserverpro.com/set-automated-exchange-2010-database-backup-alert-email#comments</comments>
		<pubDate>Mon, 30 Apr 2012 13:11:21 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Mailbox Server]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4242</guid>
		<description><![CDATA[Learn how to use PowerShell to automatically monitor your Exchange Server 2010 database backups and send an alert email when recent backups have not been successful.]]></description>
			<content:encoded><![CDATA[<p>In recent articles I&#8217;ve taken you step by step through some techniques for <a href="http://exchangeserverpro.com/powershell-how-to-send-email">sending email from PowerShell scripts</a>. If you haven&#8217;t read those articles yet you can find them here:</p>
<ul>
<li><a href="http://exchangeserverpro.com/powershell-how-to-send-email">Part 1 – How to Send SMTP Email Using PowerShell</a></li>
<li><a href="http://exchangeserverpro.com/powershell-email-message-body">Part 2 - How to Add a Message Body to Emails Sent from Scripts</a></li>
<li><a href="http://exchangeserverpro.com/powershell-send-html-email">Part 3 - How to Add a HTML Message Body to Emails Sent from Scripts</a></li>
<li><a href="http://exchangeserverpro.com/powershell-html-email-formatting">Part 4 - How to Create Formatted HTML Output from Scripts</a></li>
</ul>
<p>I also shared with you a script that can be used to <a href="http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups">check Exchange Server 2010 database backups</a> and alert you to any that have not had a recent backup.</p>
<p>Now it&#8217;s time to bring all of that information together and demonstrate how you can set up an automated database backup alert email for your <a href="http://exchangeserverpro.com">Exchange Server 2010</a> environment.</p>
<p>The two components of this are:</p>
<ul>
<li>The PowerShell script itself (we&#8217;ll use the one mentioned earlier but with some modifications to email-enable it)</li>
<li>Task Scheduler for automatically running the script each day</li>
</ul>
<h2>Script for Exchange Server 2010 Database Backup Email Alerts</h2>
<p>To email-enable the script I&#8217;ve made just a few modifications. The original script used this conditional logic to display the report in the PowerShell window.</p>
<pre>#If alert flag is true output the report
if ($alertflag -eq $true )
{
	Write-Host "The following databases have not been backed up in" $threshold "hours."
	$alerts | ft -AutoSize
}
else
{
	Write-Host "No backup alerts required."
}</pre>
<p>To change this to send an email alert we can use this code instead:</p>
<pre>#If alert flag is true send the email alert
if ($alertflag -eq $true )
{
	#HTML styles for nice formatting
        $style = "&lt;style&gt;BODY{font-family: Arial; font-size: 10pt;}"
	$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
	$style = $style + "TH{border: 1px solid black; background: #CC0000; padding: 5px; color: #FFFFFF;}"
	$style = $style + "TD{border: 1px solid black; padding: 5px; }"
	$style = $style + "&lt;/style&gt;"

        #SMTP options for sending the report email
	$smtpServer = "ho-ex2010-caht1.exchangeserverpro.net"
	$smtpFrom = "reports@exchangeserverpro.net"
	$smtpTo = "administrator@exchangeserverpro.net"
	$messageSubject = "Exchange Backup Alerts"

        $intro = "The following databases have not been backed up in " + $threshold + " hours.&lt;BR&gt;&lt;BR&gt;"
	$report = $alerts | ConvertTo-Html -Fragment

	#Get ready to send email message
	$message = New-Object System.Net.Mail.MailMessage $smtpfrom, $smtpto
	$message.Subject = $messageSubject
	$message.IsBodyHTML = $true
	$message.Body = ConvertTo-Html -Body "$intro $report" -Head $style

	#Send email message
	$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
	$smtp.Send($message)

}</pre>
<p>If any parts of that don&#8217;t make sense just refer to the previous tutorials on sending email with PowerShell.</p>
<p class="alert"><strong>Download the script file here:</strong> <a class="downloadlink" href="http://exchangeserverpro.com/wp-content/plugins/download-monitor/download.php?id=Get-DailyBackupAlerts.zip" title="Version 1.0 downloaded 192 times" >Get-DailyBackupAlerts.ps1</a> (downloaded 192 times so far)</p>
<p>If you&#8217;re using this script in your environment you will need to change the SMTP options to suit.</p>
<pre>
#SMTP options for sending the report email
$smtpServer = "ho-ex2010-caht1.exchangeserverpro.net"
$smtpFrom = "reports@exchangeserverpro.net"
$smtpTo = "administrator@exchangeserverpro.net"
$messageSubject = "Exchange Backup Alerts"
</pre>
<p>Save the script as <strong>Get-DailyBackupAlerts.ps1</strong> in a folder called <strong>C:\Scripts</strong> on the server where you would like it to run each day. Note that the script depends on the Exchange Server 2010 management tools, so they will also need to be installed.</p>
<h2>Using Task Scheduler to Run PowerShell Scripts</h2>
<p>Now we need to configure the scheduled task in Task Scheduler. On a Windows Server 2008 server you&#8217;ll find this in the <strong>Administrative Tools</strong>. After you&#8217;ve launched Task Scheduler click on <strong>Create Task</strong>.</p>
<p><img class="aligncenter size-full wp-image-4243" title="task-scheduler-powershell-script-01" src="http://exchangeserverpro.com/wp-content/uploads/2011/11/task-scheduler-powershell-script-01.jpg" alt="" width="305" height="290" />Give the task a meaningful name, set it to <strong>Run whether user is logged on or not</strong>, and also if necessary change the user account that it will run as (you may wish to create a special Exchange administrative account with a strong password for running these types of scripts).</p>
<p><img class="aligncenter size-full wp-image-4244" title="task-scheduler-powershell-script-02" src="http://exchangeserverpro.com/wp-content/uploads/2011/11/task-scheduler-powershell-script-02.jpg" alt="" width="590" height="439" />On the <strong>Triggers</strong> tab click new and add a <strong>Weekly</strong> trigger for each of your normal business days that you want the script to run (eg Monday &#8211; Friday). Set the <strong>Start</strong> time to suit your normal backups finishing time and your own work schedule.</p>
<p><img class="aligncenter size-full wp-image-4245" title="task-scheduler-powershell-script-03" src="http://exchangeserverpro.com/wp-content/uploads/2011/11/task-scheduler-powershell-script-03.jpg" alt="" width="556" height="439" /></p>
<p>On the <strong>Actions</strong> tab click <strong>New</strong> and add an action of Start a program. Configure the program of <strong>powershell.exe</strong> and the arguments <strong>-command &#8220;c:\scripts\get-dailybackupalerts.ps1&#8243;</strong></p>
<p><img class="aligncenter size-full wp-image-4248" title="task-scheduler-powershell-script-04" src="http://exchangeserverpro.com/wp-content/uploads/2011/11/task-scheduler-powershell-script-04.jpg" alt="" width="552" height="428" /></p>
<p>&nbsp;</p>
<p>Click <strong>OK</strong> to finish creating the new task. You will be prompted to enter the credentials for the account that you configured the task to run as.</p>
<p>Now you can test the scheduled task by right-clicking on it in the Task Scheduler Library and choosing <strong>Run</strong>.</p>
<p><img class="aligncenter size-full wp-image-4247" title="task-scheduler-powershell-script-05" src="http://exchangeserverpro.com/wp-content/uploads/2011/11/task-scheduler-powershell-script-05.jpg" alt="" width="503" height="244" />Assuming you have some databases that have not backed up recently you should receive an alert email shortly after running the scheduled task.</p>
<p><em>Note: if your backups are all up to date you can test the script by changing the <strong>$threshold</strong> variable to something very low such as <strong>1</strong>.</em></p>
<p><img class="aligncenter size-full wp-image-4249" title="exchange-2010-backup-alert-email" src="http://exchangeserverpro.com/wp-content/uploads/2011/11/exchange-2010-backup-alert-email.jpg" alt="" width="590" height="229" /></p>
<p class="alert"><strong>Download the script file here:</strong> <a class="downloadlink" href="http://exchangeserverpro.com/wp-content/plugins/download-monitor/download.php?id=Get-DailyBackupAlerts.zip" title="Version 1.0 downloaded 192 times" >Get-DailyBackupAlerts.ps1</a> (downloaded 192 times so far)</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-2010-database-backups" title="PowerShell Script: Check Exchange 2010 Database Backups">PowerShell Script: Check Exchange 2010 Database Backups</a></li><li><a href="http://exchangeserverpro.com/powershell-script-check-exchange-mailbox-database-backup-time" title="PowerShell Script: Check Exchange Mailbox Database Last Backup Time">PowerShell Script: Check Exchange Mailbox Database Last Backup Time</a></li><li><a href="http://exchangeserverpro.com/avoid-running-transaction-log-disk-space-exchange-servers" title="Avoid Running Out of Transaction Log Disk Space on Exchange Servers">Avoid Running Out of Transaction Log Disk Space on Exchange Servers</a></li><li><a href="http://exchangeserverpro.com/test-mailflow-exchange-2003-servers" title="Using Test-Mailflow with Exchange 2003 Servers">Using Test-Mailflow with Exchange 2003 Servers</a></li><li><a href="http://exchangeserverpro.com/health-check-exchange-2010-mailbox-server" title="How to Health Check an Exchange 2010 Mailbox Server">How to Health Check an Exchange 2010 Mailbox Server</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/set-automated-exchange-2010-database-backup-alert-email">How to Set Up an Automated Exchange 2010 Database Backup Alert Email</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/set-automated-exchange-2010-database-backup-alert-email/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Calculate Daily Email Traffic using Message Tracking Logs and Log Parser</title>
		<link>http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser</link>
		<comments>http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser#comments</comments>
		<pubDate>Tue, 17 Apr 2012 13:03:05 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Log Parser]]></category>
		<category><![CDATA[Message Tracking]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4738</guid>
		<description><![CDATA[How to use Log Parser to generate a daily email traffic report from the Exchange Server message tracking logs.]]></description>
			<content:encoded><![CDATA[<p>One of the useful reports you can extract from <a href="http://exchangeserverpro.com/exchange-2010-message-tracking">message tracking logs</a> is the daily email message traffic load for an <a href="http://exchangeserverpro.com">Exchange server</a>.</p>
<p>I run this report almost every day (we retain up to 30 days of message tracking logs so running every day is not required) to look for any patterns or trends that may concern us.</p>
<p>The report can be quickly generated using <a href="https://www.google.com.au/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CEUQFjAA&amp;url=http%3A%2F%2Fwww.microsoft.com%2Fdownload%2Fen%2Fdetails.aspx%3Fid%3D24659&amp;ei=LmaNT_m6Ko-viQfL4eX1DA&amp;usg=AFQjCNHTO3l_25MD8EYjl0erwi398mSb8g">Log Parser</a>. Install it on the server and run the following query from the folder where the message tracking logs are stored.</p>
<pre>SELECT TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING([#Fields: date-time]),0,'T'), 'yyyy-MM-dd')) AS Date,
       COUNT(*) AS Hits
from *.log
where (event-id='RECEIVE')
GROUP BY Date
ORDER BY Date ASC</pre>
<p>As a single command line it will be as follows:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING([#Fields: date-time]),0,'T'), 'yyyy-MM-dd')) AS Date, COUNT(*) AS Hits from *.log where (event-id='RECEIVE') GROUP BY Date ORDER BY Date ASC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>This will give you output similar to this:</p>
<pre>Date       Hits
---------- ----
2012-03-17 5311
2012-03-18 2575
2012-03-19 6296
2012-03-23 283
2012-03-24 1
2012-03-25 1
2012-03-26 5
2012-03-27 1
2012-03-29 635
2012-03-30 255
2012-03-31 883
2012-04-01 856
2012-04-02 1051
2012-04-03 1178
2012-04-04 1145
2012-04-05 1138
2012-04-06 1203
2012-04-07 866
2012-04-08 1016
2012-04-09 1210
2012-04-10 1171
2012-04-11 833
2012-04-12 26
2012-04-14 21
2012-04-15 1

Statistics:
-----------
Elements processed: 106917
Elements output:    25
Execution time:     2.66 seconds</pre>
<p>Pretty useful on its own, but if you plan to create graphical reports using this data you can save yourself a bit of time and let Log Parser generate the chart for you, as long as you have Office or the Office Web Components installed on the computer running Log Parser.</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING([#Fields: date-time]),0,'T'), 'yyyy-MM-dd')) AS Date, COUNT(*) AS [Daily Email Traffic] INTO DailyTraffic.gif from *.log where (event-id='RECEIVE') GROUP BY Date ORDER BY Date ASC" -i:CSV -nSkipLines:4 -chartType:Column3D</pre>
<p><img class="aligncenter size-full wp-image-4739" title="DailyTraffic" src="http://exchangeserverpro.com/wp-content/uploads/2012/04/DailyTraffic.gif" alt="" width="590" height="442" /></p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser" title="Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser">Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser" title="Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser">Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser</a></li><li><a href="http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs" title="Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs">Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser" title="Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser">Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell" title="Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell">Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser">Calculate Daily Email Traffic using Message Tracking Logs and Log Parser</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser</title>
		<link>http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser</link>
		<comments>http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser#comments</comments>
		<pubDate>Fri, 13 Apr 2012 12:52:42 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Log Parser]]></category>
		<category><![CDATA[Message Tracking]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4707</guid>
		<description><![CDATA[How to generate a Log Parser report summarizing the message tracking events that have occurred on an Exchange 2010 server.]]></description>
			<content:encoded><![CDATA[<p>In another article I showed how to use <a href="http://exchangeserverpro.com/powershell">PowerShell</a> to create a <a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell">summary report of the message tracking event IDs</a> that have occurred on an Exchange 2010 server.</p>
<p>In some cases these types of summary reports are faster and easier to extract using Log Parser instead of PowerShell. Let&#8217;s take a look at the Log Parser query to generate the same report as in the other article.</p>
<pre>SELECT
   event-id AS Event,
   COUNT(*) As HITS
from *.log
GROUP BY Event
ORDER BY HITS DESC</pre>
<p>This query will select the event-id field, a count of total log entries, grouped by event-id, and sort them in order of most to least hits.</p>
<p>The complete query, when executed from the directory containing the message tracking logs, is as follows:</p>
<pre>"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT event-id AS Event, COUNT(*) As HITS from *.log GROUP BY Event ORDER BY HITS DESC" -i:CSV -nSkipLines:4 -rtp:-1</pre>
<p>That query will produce a report similar to this:</p>
<pre>Event       HITS
----------- -----
RECEIVE     58679
DELIVER     47496
NOTIFYMAPI  20812
SUBMIT      20806
SEND        19863
RESUBMIT    8679
HAREDIRECT  6826
TRANSFER    351
DSN         96
FAIL        95
SUBMITDEFER 6
BADMAIL     2

Statistics:
-----------
Elements processed: 183756
Elements output:    13
Execution time:     9.24 seconds</pre>
<p>Aside from the speed benefits of Log Parser over Get-MessageTrackingLog you can also save time by generating graphical reports directly out of Log Parser if you have the Office Web Components also installed.</p>
<div id="attachment_4713" class="wp-caption aligncenter" style="width: 610px"><img class="size-large wp-image-4713" title="Column Chart from Log Parser" src="http://exchangeserverpro.com/wp-content/uploads/2012/04/Events-600x450.gif" alt="Column Chart from Log Parser" width="600" height="450" /><p class="wp-caption-text">Column Chart from Log Parser</p></div>
<p>That query is as follows:</p>
<pre>
"C:\Program Files (x86)\Log Parser 2.2\logparser.exe" "SELECT event-id AS Event, COUNT(*) As HITS INTO Events.gif from *.log GROUP BY Event ORDER BY HITS DESC" -i:CSV -nSkipLines:4 -chartType:Column3D
</pre>
<p>This type of information would be useful to see on a regular basis, so you could simply schedule this Log Parser query to run at certain intervals and use an HTML page or an automatic email to view the results each time.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser" title="Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser">Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser" title="Calculate Daily Email Traffic using Message Tracking Logs and Log Parser">Calculate Daily Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/generate-smtp-error-statistics-using-log-parser-and-exchange-server-2010-protocol-logs" title="Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs">Generate SMTP Error Statistics using Log Parser and Exchange Server 2010 Protocol Logs</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-report-top-sender-ips-log-parser" title="Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser">Report Top Sender IP&#8217;s on Exchange Server 2010 using Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell" title="Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell">Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser">Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell</title>
		<link>http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell</link>
		<comments>http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell#comments</comments>
		<pubDate>Fri, 13 Apr 2012 12:52:32 +0000</pubDate>
		<dc:creator>Paul Cunningham</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Message Tracking]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://exchangeserverpro.com/?p=4706</guid>
		<description><![CDATA[How to generate a summary of the message tracking events that have occurred on Exchange Server 2010 using PowerShell.]]></description>
			<content:encoded><![CDATA[<p>A useful report to generate from the <a href="http://exchangeserverpro.com/exchange-2010-message-tracking">Exchange Server 2010 message tracking logs</a> is a summary of the different message tracking events that have occurred.</p>
<p>Each message tracking log entry records an event ID from <a href="http://technet.microsoft.com/en-us/library/cc539064.aspx">the following list</a>:</p>
<ul>
<li>BADMAIL</li>
<li>DELIVER</li>
<li>DSN</li>
<li>EXPAND</li>
<li>FAIL</li>
<li>POISONMESSAGE</li>
<li>RECEIVE</li>
<li>REDIRECT</li>
<li>RESOLVE</li>
<li>SEND</li>
<li>SUBMIT</li>
<li>TRANSFER</li>
</ul>
<p>Each event means different things. Healthy messages may record multiple receive, send, transfer, submit or deliver events, depending on your environment. Unhealthy messages may record badmail or fail events.</p>
<p>While there is no hard and fast rules about what percentage of each event you should see, it is still useful to take a look at a summary of the different events IDs in case you notice something that may warrant further investigation.</p>
<p>You can generate this summary using <a href="http://exchangeserverpro.com/powershell">PowerShell</a> and the <a href="http://technet.microsoft.com/en-us/library/aa997573.aspx">Get-MessageTrackingLog</a> cmdlet.</p>
<pre>[PS] C:\&gt;Get-MessageTrackingLog -ResultSize Unlimited | Group-Object -Property:EventId | Sort-Object Count -Desc | Select Name,Count

Name        Count
----        -----
RECEIVE     58679
DELIVER     47496
NOTIFYMAPI  20812
SUBMIT      20806
SEND        19863
RESUBMIT     8679
HAREDIRECT   6826
TRANSFER      351
DSN            96
FAIL           95
SUBMITDEFER     6
BADMAIL         2</pre>
<p>For more tips and examples on <a href="http://exchangeserverpro.com/exchange-2010-message-tracking-log-search-powershell">searching message tracking logs with PowerShell</a> check out <a href="http://exchangeserverpro.com/exchange-2010-message-tracking-log-search-powershell">this article</a>.</p>
<p>Incidentally you may find this type of summary report to be faster to generate using Log Parser instead. In my tests the PowerShell command took almost 5 minutes to complete, whereas Log Parser took only 9 seconds on the same server. Your mileage may vary. You can check out the Log Parser query <a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser">here</a>.</p>
<h3  class="related_post_title">Related posts:</h3><ul class="related_post"><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-log-search-powershell" title="Searching Exchange Server 2010 Message Tracking Logs with PowerShell">Searching Exchange Server 2010 Message Tracking Logs with PowerShell</a></li><li><a href="http://exchangeserverpro.com/calculate-hourly-email-traffic-using-message-tracking-log-parser" title="Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser">Calculate Hourly Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/daily-email-traffic-message-tracking-log-parser" title="Calculate Daily Email Traffic using Message Tracking Logs and Log Parser">Calculate Daily Email Traffic using Message Tracking Logs and Log Parser</a></li><li><a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser" title="Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser">Reporting Exchange Server 2010 Message Tracking Event IDs with Log Parser</a></li><li><a href="http://exchangeserverpro.com/powershell-script-create-mailbox-size-report-exchange-server-2010" title="Get-MailboxReport.ps1 &#8211; PowerShell Script to Generate Mailbox Reports">Get-MailboxReport.ps1 &#8211; PowerShell Script to Generate Mailbox Reports</a></li></ul><hr />
<p>This article <a href="http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell">Reporting Exchange Server 2010 Message Tracking Event IDs with PowerShell</a> is © 2012 ExchangeServerPro.com</p>
<p>Get more <a href="http://exchangeserverpro.com">Exchange Server tips</a> at <a href="http://exchangeserverpro.com">ExchangeServerPro.com</a></p>]]></content:encoded>
			<wfw:commentRss>http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-powershell/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

