logo
search
Others

How to Configure Automatic Replies for Exchange Online using PowerShell

Aamir Naveed AkramAamir Naveed Akram Oct 26, 2026 869 views

Question details

Exchange administrators need to configure automatic replies, including schedules and internal/external messages, for Exchange Online mailboxes using PowerShell.

How to Configure Automatic Replies for Exchange Online Mailboxes with PowerShell
Product
Exchange Online
Device & OS
not provided
Scenario
An IT administrator wants to programmatically set up out-of-office messages and schedules for one or more users in the organization.
Observed behavior
The administrator must correctly apply the Set-MailboxAutoReplyConfiguration cmdlet or build an appropriate script for organization-wide updates.
Before you start

Ensure that you have installed the Exchange Online PowerShell module and have authenticated with Microsoft 365 using an account with appropriate administrative privileges (such as the Exchange Administrator role).

Solution 1Recommended

Configure Automatic Replies for a Single Mailbox

Use the Set-MailboxAutoReplyConfiguration cmdlet to directly enable and set up out-of-office messages for an individual user.

This direct approach is the standard method for managing a single user's automatic replies. You can specify distinct messages for senders inside and outside your organization.

1
Connect to Exchange Online

Open your PowerShell terminal as an administrator and run the 'Connect-ExchangeOnline' command to authenticate with your Microsoft 365 tenant.

2
Run the configuration cmdlet

Execute the command: Set-MailboxAutoReplyConfiguration -Identity 'user@yourdomain.com' -AutoReplyState Enabled -InternalMessage 'I am out of the office.' -ExternalMessage 'I am currently away and will reply later.' Ensure you replace the identity and messages with your specific details.

3
Verify the settings

To confirm the changes were applied correctly, run 'Get-MailboxAutoReplyConfiguration -Identity user@yourdomain.com' and check the output properties.

Configure Automatic Replies for a Single Mailbox
Free Microsoft Office alternative

Draft Professional Out-of-Office Templates with WPS Office

While applying Exchange configuration requires PowerShell, drafting your internal and external out-of-office messages is best done in a reliable word processor. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, perfect for creating and storing professional communication templates.

  1. 1. Open WPS Writer: Launch WPS Office and open a new Writer document to draft your out-of-office messages.
  2. 2. Draft the template: Write and format your internal and external automatic replies, ensuring all essential contact details and dates are included.
  3. 3. Copy to PowerShell: Copy the finalized text from WPS Writer directly into your PowerShell script's message parameters.
Free and lightweight Microsoft Office alternativeSeamless compatibility with Microsoft Word, Excel, and PowerPoint formatsDraft error-free internal and external auto-reply templatesFamiliar user interface ensures zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Can I set a scheduled automatic reply with PowerShell?

Yes. By setting the -AutoReplyState parameter to 'Scheduled', you can use the -StartTime and -EndTime parameters to specify the exact date and time the out-of-office messages should activate and deactivate.

How do I turn off automatic replies for a mailbox via PowerShell?

To disable an active auto-reply, run the Set-MailboxAutoReplyConfiguration cmdlet for the target mailbox and set the -AutoReplyState parameter to 'Disabled'.

Can I format the PowerShell auto-reply message using HTML?

Yes, Exchange Online accepts HTML formatting for both the -InternalMessage and -ExternalMessage parameters. Simply format your text with standard HTML tags (like <b> or <br>) and enclose the entire HTML string in matching quotes when running the cmdlet.