Comments
Comments made
admin wrote:
To get it so that it shows you the number of emails, change the QUIT to RCPT as in the following line:
logparser "SELECT * FROM \\pr-ex1\c$\WINDOWS\system32\LogFiles\SMTPSVC1\ex*.log WHERE cs-username LIKE 'OutboundConnectionCommand' AND cs-method = 'RCPT'" -o:CSV > SMTP_Outbound-email.CSV
logparser "SELECT * FROM \\pr-ex1\c$\WINDOWS\system32\LogFiles\SMTPSVC1\ex*.log WHERE cs-username LIKE 'OutboundConnectionCommand' AND cs-method = 'RCPT'" -o:CSV > SMTP_Outbound-email.CSV
Thu 03.27.08 10:57:53
admin wrote:
To view the number of Inbound connections:
logparser "SELECT * FROM \\pr-ex1\c$\WINDOWS\system32\LogFiles\SMTPSVC1\ex*.log WHERE cs-username NOT LIKE 'OutboundConnectionCommand' AND cs-method = 'QUIT'" -o:CSV > c:\temp\SMTP_Outbound.CSV
logparser "SELECT * FROM \\pr-ex1\c$\WINDOWS\system32\LogFiles\SMTPSVC1\ex*.log WHERE cs-username NOT LIKE 'OutboundConnectionCommand' AND cs-method = 'QUIT'" -o:CSV > c:\temp\SMTP_Outbound.CSV
Mon 06.02.08 16:03:07

Thu 03.27.08: Number of Outbound SMTP connections
I need to find out how to get a list of all of the Outbound SMTP connections that our Exchange server has done over a time period for load issues. To do this, I decided to use LogParser.LogParser 2.2 can be found here:
www.microsoft.com
First you need to go into the SMTP properties and make sure that you are logging the following advanced log fields: cs-username, and cs-method. I turn on all logging so that I can run statistics on some of the stuff after I import the data.
To get just a list of all of the connections to outbound SMTP hosts, I used the following Log Parser command line:
logparser "SELECT * FROM \\pr-ex1\c$\WINDOWS\system32\LogFiles\SMTPSVC1\ex*.log WHERE cs-username LIKE 'OutboundConnectionCommand' AND cs-method = 'QUIT'" -o:CSV > SMTP_Outbound.CSV
This will look at all the log files found on a server named pr-ex1 and only return the ones that have OutboundConnectionCommand in the cs-username field and QUIT in the cs-method field.
Basically it will return a result when it closed the connection with the remote SMTP server. It will save it as file called SMTP_Outbound.CSV in CSV format (comma delimited) in directory you are running logparser from.
Item Rating Information....
Total Votes: 12 - Rating: 1.00