SharePoint 2007 – Monitor Incoming Email with PowerShell   Leave a comment

EDIT: Ages later……I’ve still not done the public version of this script, its around 1.5k lines in production and bah.   If you really really want this, let me know and I’ll make the effort. 

Well it’s a big script of about 1000 lines or so, but I like it, and it works, and I finished it today, v1.0 beta at any rate.

What does it do, and how does it do it?

Well, it ferckles through the IIS SMTP Logs and the SharePoint ULS logs (with E-Mail logging turned to max – naturally!) and gives you:

HTML Reports

Top e-mailers per X hours (where you decide X).
List of e-mails incoming and both senders and recipients.
Exchange server list (which internal servers are forwarding emails to us).
List of total e-mails received and average incoming per hour!

EDIT: Oh yes – you can also see “errors” (note to self: which was the whole point really now wasn’t it?)

I’m working on a conversion to be able to post it here, and hopefully will have that done within the week!

Tech stuff:

It has: – Guest appearances by Microsoft LogParser.   File StreamReader to read open ULS logs.   Plenty of regular expressions, and a dash of “read from SharePoint config database” to get your SharePoint email addresses to go check against.

I’m toying with the idea of doing the final hop – reading back from the library the email address belongs with, to ensure the E-Mail Timer Job did do it’s thing correctly.  Hummm about that, not sure, and can’t remember if thats possible to construct from an initial config database read ( I know about the SharePointy API stuff) or it maybe needs something else…

Watch this space!



Posted January 19, 2011 by stormwalker255 in SharePoint

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: