Created
November 5, 2017 13:40
-
-
Save janegilring/379d23507fc0b40960ebc8e9455bc875 to your computer and use it in GitHub Desktop.
Set-MailboxAutoReplyConfiguration demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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