Your PowerGUI Community: Simplify your PowerShell related GUI and script editing needs.


Exchange 2003 Script?

This question is not answered
Hi

Not sure if this is possible, but I have a scenario that id like to fix by a script, here is the scenario

One mailbox sitting on an Exchange 2003 Server, the mailbox receives emails in the following format:

From: External@Contoso.com
To: Internal@Domain.com
Subject:UserX

Any Attachment

UserX is anyone of 700 users at the company, we have five file servers i.e \\london\users\user1
\\portsmouth\users\user2
\\scotland\users\user3
\\wales\users\user4
\\newcastle\users\user5

Users My Documents are assigned via GPO, i.e London Users have there H drive mapped to the London File Server, Portsmouth Users have there H Drive mapped to the Portsmouth File Server.

Attachments are sent via email to one internal address from another external address, with the username who it is intended for in the subject.

What id like to do is create a script that pulls the username from the subject, queries 5 groups in AD i.e (London Users, Portsmouth Users, Wales Users, Scotland Users, Newcastle Users and depending where it finds the user place the file in the users my documents on that file server.

Does this sound possible?

Regards

SI
All Replies
  • The hard part is getting the email data out of an Exchange server. The rest is easy. But I have had this snippet tucked away for awhile, I just haven't had a need yet to try it.

    http://slipsec.com/blog/?p=268

    Now, of you don't have Exchange that's a whole 'nother issue! Hopefully that gets you started in the right direction.
  • Here's another blog where this guy is doing a ton of stuff with Powershell and Exchange.

    http://gsexdev.blogspot.com/
  • Thanks for that some great information there, but both look targeted at Exchange 2007/2010. Might have to bite the bullet and upgrade!
  • Sorry, didn't see the Exchange 2003 reference! Since you are running on a 10 year old version of Exchange, I'd say upgrading is a worthy project :D That said, Exchange 2010 is A LOT different then 2003, so study up before you go or get a good consultant.

    But to make this work for Exchange 2003 you'll need to install Outlook and then use the Outlook ComObject to get the email. Should be plenty of examples on how to do this on Google.
  • Exchange 2003 remote management was provided through WMI. Complex to work with, but not impossible. Here's a pointer to the Exchange 2003 WMI Mailbox Class:

    http://msdn.microsoft.com/en-us/library/exchange/aa143732(v=exchg.65).aspx

    It's been a very long time since I worked with PowerShell and Exchange 2003 and it looks like I've deleted my script archives from back then, so not much help from here. Hopefully, this you give you something to start with.