3

I work three days a week and need to set an out of office for Mondays and Thursdays, but I do not remember to set it each Friday and Wednesday before I leave. Can I set up a recurring out of office for just these days?

Liz
  • 31

1 Answers1

1

if you are able to make a scheduled task and you have sufficient permissions to do this you could use this script. If you make 2 scripts you can schedule script 1 to run on Wednesday 5pm(?) and then set the part where it says .AddDays(1) to 2. and you can make the other script to run on Friday 5PM(?) and set the adddays thing to 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
Kage
  • 367