VBScript for automate the user's Out of Office state in Outlook using Exchange Web Services with autologon.
Edit ewsOOF.vbs:
userEmail = "[email protected]"
OofState = "Enabled" 'Disabled or Enabled
ExternalAudience = "None" 'None or Known or All
InternalReply = "Out of office message" 'Internal message
ExternalReply = "" 'External message
ExchangeUrl = "https://exchangehost/EWS/Exchange.asmx" 'EWS Url
Run CreateOOFScheduler.bat. Script creates scheduled task:
set "scriptPath="wscript //b //nologo '%cd%\ewsOOF.vbs'""
schtasks /create /tn OutOfOffice_Enable /tr %scriptPath% /sc weekly /d MON,TUE,WED,THU,FRI /st 15:55:00
Run DeleteOOFScheduler.bat:
schtasks /delete /tn OutOfOffice_Enable /f