Outlook OoO每天发送一封电子邮件

时间:2013-08-20 08:21:22

标签: vba powershell outlook scheduled-tasks exchange-server

Outlook有一个标准功能,即当有人外出度假或缺席时发送外出(OOO)消息。

标准功能是在整个OoO激活期间,OoO只发送1条消息。您可以通过在OoO中添加规则,使Outlook使用邮件模板向每个人发送邮件。 (不推荐)

只发送一次邮件,很少;每次发送邮件都是很多。

有没有办法让OoO每封电子邮件地址每天只发送一个人缺席的邮件? (我仍然想知道为什么这不是Outlook中的标准功能)

1 个答案:

答案 0 :(得分:0)

我发现了这篇文章,它描述了一个小型的PowerShell脚本,它通过每晚运行一次来​​实现这一目标。

http://san.schausberger.cc/2013/07/how-to-change-exchange-2010-out-of-office-ooo-oof-interval/

它记录OOO状态(启用或禁用),将状态设置为禁用+将其重置为先前记录的状态。这重新触发了“一次性回复”行为。

$enabled = get-mailbox -resultsize unlimited
|get-mailboxautoreplyconfiguration | where {$_.autoreplystate -eq
"enabled"} | select identity,autoreplystate $enabled | foreach-object
{ set-mailboxautoreplyconfiguration $_.identity -autoreplystate
"Disabled" set-mailboxautoreplyconfiguration $_.identity
-autoreplystate $_.autoreplystate }

稍微调整一下,我确信您可以对其进行修改,以便只有OZ邮箱存储中的邮箱受到影响。 然后可以将其设置为作为计划任务运行:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
-command “. ‘C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1′; Connect-ExchangeServer -auto; c:\reset_outofoffice.ps1″