views:

43

answers:

2

I would like to set up functionality where a powershell script would access the email in a specific mailbox. It would then parse each email to engage in dialog with a specific set of users. To serve as a system that could be interacted with through email. How could this be pulled off?

A: 

I'd start with the EWS managed API and my sample. Glen's blog has a MUCH deeper explanation. exchange.webservices.data.itemview is the key class (search), and with overview and the countless examples from Glen's blog- you should be off to a good start.

slipsec
The trade off for this method is that you can choose to run as a different user. @nimizen has the easier solution if you do not.
slipsec
+1  A: 

If you want to run this from a client with Outlook installed then the following is a good starting point (EWS is not required).

$olFolderInbox = 6
$outlook = new-object -com outlook.application;
$mapi = $outlook.GetNameSpace("MAPI");
$inbox = $mapi.GetDefaultFolder($olFolderInbox)
$inbox | gm