How to use Powershell to Monitor a specific inbox for Commands?

拜拜、爱过 提交于 2019-12-24 08:15:21

问题


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?


回答1:


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



回答2:


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.



来源:https://stackoverflow.com/questions/3560490/how-to-use-powershell-to-monitor-a-specific-inbox-for-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!