![经常不在办公室?](https://linux22.com/image/1505215/%E7%BB%8F%E5%B8%B8%E4%B8%8D%E5%9C%A8%E5%8A%9E%E5%85%AC%E5%AE%A4%EF%BC%9F.png)
我每周工作三天,需要设置周一和周四的外出办公时间,但我忘了在每周五和周三下班前设置。我可以只为这些天设置重复外出办公时间吗?
答案1
如果您能够制定计划任务,并且您有足够的权限执行此操作,则可以使用此脚本。如果您制作了 2 个脚本,则可以安排脚本 1 在星期三下午 5 点运行(?),然后将其中的部分设置.AddDays(1)
为 2。您可以让另一个脚本在星期五下午 5 点运行(?),并将该adddays
部分设置为 4
$identity = "email address"
$autoReplyState = "Scheduled"
$externalMessage = "Enter a message shown to people outside of your domain"
$internalMessage = "Enter a message shown to people inside of your domain"
#this means it will start now
$startTime = Get-Date
#this means it will end now + 1 day
$endTime = $startTime.AddDays(1)
# Import the Exchange Modules
## This part is is for Exchange 2010, Required managements tools to be installed.
## remove the # at the start of the next line if you wish to use exchange 2010
# add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
##This part is for Exchange 2013/2016
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://ExchangeServer/PowerShell/ -Authentication Kerberos
Import-PSSession $Session -DisableNameChecking
Set-MailboxAutoReplyConfiguration -Identity $identity -AutoReplyState $autoReplyState -StartTime $startTime -EndTime $endTime -InternalMessage $internalMessage -ExternalMessage $externalMessage