Freigeben über


Configure Auto Reply for a Mailbox

Administrators can view and configure auto reply settings for an Exchange Online mailbox using the Set-MailboxAutoReplyConfiguration and Get-MailboxAutoReplyConfiguration PowerShell cmdlets.

 

Using Set-MailboxAutoReplyConfiguration, you can schedule an automated reply to start at a specific time.  For example, to create a scheduled auto reply that starts at 6:00 pm Eastern Daylight Time (EDT) on August 16 and ends at 6:00 pm EDT on August 17, I would run the following command: 

 

Set-MailboxAutoReplyConfiguration -Identity tmcmichael -AutoReplyState Scheduled -StartTime "18:00 8/16/2017" –EndTime "18:00 8/17/2017"

 

When the command has completed successfully, you can verify the settings in Outlook, as shown below. 

 

image

 

Interestingly, Outlook indicates a start and end time of 2:00 pm, not 18:00 (6:00 pm).  Get-MailboxAutoReplyConfiguration also shows 2:00 pm as the configured start/stop times.

 

PS C:\> Get-MailboxAutoReplyConfiguration -Identity tmcmichael

RunspaceId : 1a9aa7f0-e144-4b66-b799-ef1bb329a4c5
AutoDeclineFutureRequestsWhenOOF : False
AutoReplyState : Scheduled
CreateOOFEvent : False
DeclineAllEventsForScheduledOOF : False
DeclineEventsForScheduledOOF : False
EventsToDeleteIDs :
EndTime : 8/17/2017 2:00:00 PM
ExternalAudience : All
ExternalMessage :
InternalMessage :
DeclineMeetingMessage :
OOFEventSubject :
StartTime : 8/16/2017 2:00:00 PM
MailboxOwnerId : Timothy McMichael
Identity : Timothy McMichael
IsValid : True
ObjectState : Unchanged

 

Both Outlook and the PowerShell output are correct. This is because Set-MailboxAutoReplyConfiguration uses the time zone on the Exchange server.  All Exchange Online servers use GMT for their time zone settings. 18:00 GMT is 14:00 EDT.

 

So how do I get the auto reply to start and stop at 6:00pm?  The easiest way is to simply convert the desired time to GMT.  In my example, the user is in EDT which is GMT-4.  Since I want to have the auto reply start and stop at 18:00 EDT, I add 4 hours to get the time in GMT (in this case, 22:00 GMT):

 

Set-MailboxAutoReplyConfiguration -Identity tmcmichael -AutoReplyState Scheduled -StartTime "22:00 8/16/2017" –EndTime "22:00 8/17/2017"

 

Outlook now shows 6:00pm: 

 

image

 

And so does Get-MailboxAutoReplyConfiguration: 

 

PS C:\> Get-MailboxAutoReplyConfiguration -Identity tmcmichael

RunspaceId : 1a9aa7f0-e144-4b66-b799-ef1bb329a4c5
AutoDeclineFutureRequestsWhenOOF : False
AutoReplyState : Scheduled
CreateOOFEvent : False
DeclineAllEventsForScheduledOOF : False
DeclineEventsForScheduledOOF : False
EventsToDeleteIDs :
EndTime : 8/17/2017 6:00:00 PM
ExternalAudience : All
ExternalMessage :
InternalMessage :
DeclineMeetingMessage :
OOFEventSubject :
StartTime : 8/16/2017 6:00:00 PM
MailboxOwnerId : Timothy McMichael
Identity : Timothy McMichael
IsValid : True
ObjectState : Unchanged

 

One last note…Get-MailboxAutoReplyConfiguration will always show the time converted to the time zone of the machine used to run the command.  In this example, the management session was established from a machine in EDT, thereby displaying the time in EDT.  If the machine was in Mountain Standard Time (MST) the time would be converted to MST.