Skip to content

Instantly share code, notes, and snippets.

@janegilring
Created November 5, 2017 13:40
Show Gist options
  • Save janegilring/379d23507fc0b40960ebc8e9455bc875 to your computer and use it in GitHub Desktop.
Save janegilring/379d23507fc0b40960ebc8e9455bc875 to your computer and use it in GitHub Desktop.
Set-MailboxAutoReplyConfiguration demo
# Credential for the user mailbox to configure Out-of-office schedule for
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
$EXOModule = Import-PSSession $Session
# Customize as needed - for example, setup as parameters for a function/script
$StartTime = Get-Date 08:00
$EndTime = Get-Date 16:00
# AutoReplyState = Enabled/Disabled/Scheduled
Set-MailboxAutoReplyConfiguration -Identity [email protected] -StartTime $StartTime -EndTime $EndTime -AutoReplyState Enabled
# Cleanup
Remove-Module -Name $EXOModule.Name
Remove-PSSession $Session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment