经常不在办公室?

经常不在办公室?

我每周工作三天,需要设置周一和周四的外出办公时间,但我忘了在每周五和周三下班前设置。我可以只为这些天设置重复外出办公时间吗?

答案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

相关内容