Powershell 在新电子邮件事件上调用 Web 服务 (Exchange 2010)
我有 Exchange 2010,并且需要使用 Web 服务对进入邮箱的每封新电子邮件运行一个进程。该过程基本上会将电子邮件添加到内部任务列表中。
我可以为此使用 Powershell 吗?
之前从未使用过 Powershell,我并不真正了解它的功能。
如果没有,除了每 X 秒监控邮箱之外,任何人都可以建议另一种方法来执行此操作。我真的希望它基于事件,所以如果没有新邮件,则不进行处理。
干杯, 麦克风
I have Exchange 2010 and I need to run a process using web services against every new email to come in to a mailbox. The process will basically add the email to an internal task list.
Can I use Powershell for this?
Having never used Powershell before I don't really have a clue on it's capabilities.
If not can anyone suggest another way of doing this other than monitoring the mailbox every X seconds. Really I'd like it event based so if no new mail then no processing.
Cheers,
Mike
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我花了几天时间研究这个问题,似乎很难将自定义代码添加到传入电子邮件事件中。如果 Exchange 认为它正在减慢电子邮件系统的速度,那么许多实现此目的的方法就会被忽略。 (http://www.outlookcode.com/article.aspx?id=62)
另一种方法是挂钩 SMTP 事件,这种方法可以工作,但感觉有点黑客攻击。为此,您需要编写一个脚本,然后针对电子邮件到达事件进行注册。
下面是一个示例 vb 脚本,用于向通过 SMTP 发送的每封电子邮件添加随机十六进制引用。
然后运行这个来注册脚本。
要取消注册脚本,请运行以下命令;
最有弹性的方法似乎是创建一个基于计时器的系统,每 X 分钟检查一次新邮件。
不像我希望的那么光滑,但它会做。
希望这对其他人有帮助。
I have spent a few days looking into this and it seems that it's very difficult to add custom code to an incoming email event. And many of the methods of doing it will just get ignored if Exchange thinks it's slowing down the email system. (http://www.outlookcode.com/article.aspx?id=62)
The other method is to hook into the SMTP events which works but feels at bit of a hack. To do that you need to write a wscript then register that against the event of arrival of an email.
Here is an example vb script for adding a random hex reference onto every email which comes via SMTP.
Then to register the script run this.
To unregister the script run the follow;
The most resilient method seems to be to create a timer based system to check for new mails every X minutes.
Not as slick as I was hoping for but it'll do.
Hope this helps others.