Using Get-MailboxAutoReplyConfiguration in Powershell

In both Exchange Server and Exchange Online, administrators often need to verify the current Automatic Replies (Out of Office) configuration for users or shared mailboxes.
The Get-MailboxAutoReplyConfiguration cmdlet provides that visibility directly through PowerShell. It lets you see if a mailbox has automatic replies enabled, whether they are scheduled, what internal and external messages are configured, and who receives them. This cmdlet is the read-only counterpart to Set-MailboxAutoReplyConfiguration, which modifies those settings.
What is The Get-MailboxAutoReplyConfiguration Cmdlet?
Get-MailboxAutoReplyConfiguration retrieves the Automatic Replies settings for a specified mailbox in Exchange. It displays details such as AutoReplyState, StartTime, EndTime, InternalMessage, ExternalMessage, and ExternalAudience. This helps administrators review Out of Office messages, confirm scheduled replies, or audit multiple mailboxes across an organization.
The cmdlet works in both Exchange Online and on-premises Exchange Server environments. Some parameters, such as those related to domain controllers, apply only to on-premises deployments.
Syntax
Get-MailboxAutoReplyConfiguration
[-Identity] <MailboxIdParameter>
[-Credential <PSCredential>]
[-DomainController <Fqdn>]
[-ReadFromDomainController]
[-ResultSize <Unlimited>]
[-UseCustomRouting]
[<CommonParameters>]
Parameters
Each parameter defines how you target or control what data is returned.
- Identity - Specifies the mailbox to query. You can use an alias, SMTP address, GUID, UPN, distinguished name, or SamAccountName. This parameter is required.
- Credential - Allows you to run the command under alternate credentials, typically used in remote PowerShell sessions or automation scripts.
- DomainController - Specifies the fully qualified domain name (FQDN) of the domain controller that the cmdlet reads data from. Used only in on-premises Exchange.
- ReadFromDomainController - Forces the cmdlet to read data directly from the domain controller instead of a cached value. Useful in multi-domain or replication-delay scenarios.
- ResultSize - Limits how many results the cmdlet returns. You can specify a number or Unlimited to return all matching mailboxes.
- UseCustomRouting - Exchange Online only. The Microsoft documentation does not describe its behavior; it should be used only when instructed by Microsoft guidance.
- CommonParameters - Includes standard PowerShell parameters such as Verbose, Debug, ErrorAction, WarningAction, ErrorVariable, and OutVariable.
Practical Uses
The Get-MailboxAutoReplyConfiguration cmdlet is used by Exchange and Microsoft 365 administrators in many operational and compliance workflows. Below are several real-world scenarios where this cmdlet plays a critical role.
1. Auditing Out-of-Office Messages Across an Organization
When a large organization needs to ensure that users' automatic replies are set correctly - especially before major holidays or company-wide events - administrators use Get-MailboxAutoReplyConfiguration to review current configurations.
For example, it can help identify:
- Which users have AutoReplyState set to “Enabled” or “Scheduled”.
- Whose EndTime is in the past (expired) but the Out of Office message is still active.
- Whether ExternalAudience is configured for “All” instead of “Known”, which may violate internal security or compliance policies.
This data can be exported (using Export-CSV) and shared with management or HR teams to ensure proper communication handling when employees are away.
2. Troubleshooting Auto-Reply Issues in Microsoft 365 or Exchange Server
Support engineers often use Get-MailboxAutoReplyConfiguration when a user reports that their Out of Office message is not being sent or appears incorrect in Outlook or Outlook Web.
The cmdlet allows IT staff to confirm:
- Whether the AutoReplyState is actually enabled.
- The StartTime and EndTime values, to verify if the schedule is currently active.
- That the InternalMessage and ExternalMessage fields contain the expected message body text.
This direct PowerShell check is faster than navigating through the Exchange Admin Center or waiting for Outlook sync to show updated information.
3. Compliance and External Communication Control
Some organizations restrict auto-replies to external senders due to security or privacy concerns. Using Get-MailboxAutoReplyConfiguration, administrators can periodically scan all mailboxes to confirm that the ExternalAudience parameter is limited to “Known” or “None”.
This is common in financial, healthcare, or legal industries where automated replies containing internal details must not leave the organization.
Combined with other cmdlets like Get-Mailbox, admins can build scripts that report on compliance status across hundreds of mailboxes.
Prerequisites
Before you can run Get-MailboxAutoReplyConfiguration, make sure the following requirements are met:
- Permissions: You must be assigned the Mail Recipients role in Exchange Online or on-premises Exchange. Without it, the cmdlet will not be available in your PowerShell session.
- Modules:
- In Exchange Online, connect using the ExchangeOnlineManagement module and run Connect-ExchangeOnline before executing the cmdlet.
- In on-premises Exchange, use the Exchange Management Shell, which already includes this cmdlet.
- PowerShell Environment: Windows PowerShell 5.1 or later, or PowerShell 7.x with compatible modules installed.
- Network Access: Ensure that your network or Conditional Access policy allows PowerShell connections to Exchange Online PowerShell or your on-premises Exchange Server.
- Mailbox Scope: You must have permission to read properties of the mailbox or mailboxes you’re querying (for example, organizational admin or delegated rights).
How to Use Get-MailboxAutoReplyConfiguration: 7 Practical Examples
The Get-MailboxAutoReplyConfiguration cmdlet is used to check automatic reply (Out of Office) settings for single or multiple mailboxes. This section walks through several realistic use cases with correct syntax and explanations.
1. View the Automatic Replies configuration for a single mailbox
To display the current Automatic Replies settings for one user mailbox, use the -Identity parameter.
Command:
Get-MailboxAutoReplyConfiguration -Identity [email protected]
This command is often used when a user reports that their Out of Office message is not functioning properly, allowing administrators to confirm the exact configuration currently stored in Exchange.
2. Retrieve automatic reply settings for all mailboxes
Administrators can audit the entire organization by piping results from Get-Mailbox into Get-MailboxAutoReplyConfiguration.
Command:
Get-Mailbox -ResultSize Unlimited | Get-MailboxAutoReplyConfiguration
Get-Mailbox -ResultSize Unlimited retrieves all mailboxes in the tenant or Exchange organization. This command is useful for compliance reporting or identifying employees with active or misconfigured Out of Office messages.
3. Check automatic replies for shared mailboxes
Shared Mailboxes are managed the same way as user mailboxes. You simply specify the shared mailbox identity.
Command:
Get-MailboxAutoReplyConfiguration -Identity "HR Shared Mailbox"
The identity can be the display name, alias, or email address of the shared mailbox. This is helpful when shared mailboxes (for example, [email protected] or [email protected]) use automated responses during holidays or maintenance periods.
4. Display only key properties for easier reading
You can limit the displayed properties using Select-Object to make output concise.
Command:
Get-MailboxAutoReplyConfiguration -Identity [email protected] | Select-Object Identity, AutoReplyState, ExternalAudience, StartTime, EndTime
This returns only the most useful fields for quick inspection or monitoring scripts. Ideal for dashboards or simplified CSV exports.
5. Use alternate credentials or on-premises Domain Controller (Exchange Server only)
For environments where delegated admin accounts are used or where specific domain controllers must be queried, you can add -Credential or -DomainController.
Command:
$cred = Get-Credential
Get-MailboxAutoReplyConfiguration -Identity [email protected] -Credential $cred -DomainController dc1.contoso.com
-Credential lets you authenticate with different credentials if your current session doesn’t have the needed permissions.
-DomainController is valid only in on-premises Exchange and defines which domain controller to query.
Use this combination only in trusted administrative contexts; it is not supported in Exchange Online PowerShell.
6. Identify users with scheduled automatic replies
To find mailboxes where AutoReplyState is “Scheduled”, and to review upcoming Out of Office messages, you can filter output with Where-Object.
Command:
Get-Mailbox -ResultSize Unlimited | Get-MailboxAutoReplyConfiguration | Where-Object {$_.AutoReplyState -eq "Scheduled"} | Select-Object Identity, StartTime, EndTime
This command filters only those mailboxes with scheduled automatic replies. It helps identify who has planned time off or whose Out of Office schedules overlap.
Especially useful for staffing coordination or verifying employee leave notifications.
7. Checking internal vs. external messages
If you need to compare what users send internally versus externally, output both message bodies for review.
Command:
Get-MailboxAutoReplyConfiguration -Identity [email protected] | Select-Object Identity, InternalMessage, ExternalMessage
This command displays the message text configured for internal and external senders. Very useful if, let’s say, you want to verify that no sensitive internal message content is being exposed to external recipients.
Summary
The Get-MailboxAutoReplyConfiguration cmdlet gives Exchange administrators complete visibility into mailbox automatic reply settings across both Exchange Online and on-premises Exchange Server. By combining it with other PowerShell cmdlets such as Get-Mailbox, Export-CSV, and Where-Object, you can audit, troubleshoot, and maintain consistent Out of Office configurations across your Microsoft 365 tenant or on-premises organization.