logo
search
Others

How to Fix Exchange Online PowerShell Out-of-Memory Errors

Olivia MillerOlivia Miller Oct 10, 2026 870 views

Question details

The user needs to resolve an intermittent PSRemotingTransportException out-of-memory error that occurs when utilizing a C# connector with Exchange Online PowerShell.

How to Fix Exchange Online PowerShell Out-of-Memory Errors
Product
Exchange Online
Device & OS
not provided
Scenario
Running the Get-MailboxAutoReplyConfiguration cmdlet to process lists of mailbox IDs via a C# connector.
Observed behavior
The system throws a PSRemotingTransportException indicating an out-of-memory error, even when processing relatively small lists of approximately 100 objects.
Before you start

Ensure you are using the latest version of the ExchangeOnlineManagement PowerShell module (V3) and verify that your local execution environment has sufficient memory available.

Solution 1Recommended

Seek Assistance on Microsoft Q&A

Because this is an enterprise-level issue involving deep Exchange Online backend behavior and PowerShell Remoting limits, consulting Microsoft specialists is recommended.

Exchange Online imposes strict resource limits on remote PowerShell sessions. When standard client-side optimizations fail to prevent PSRemotingTransportException errors, the issue must be investigated by Microsoft's backend engineering team.

1
Navigate to Microsoft Q&A

Open your web browser and go to the official Microsoft Q&A platform at https://learn.microsoft.com/en-us/answers/.

2
Tag your issue appropriately

When creating a new post, ensure you add tags for 'Exchange Online' and 'PowerShell' so that the appropriate Microsoft support specialists and community experts see your question.

3
Provide detailed logs

Include your C# connector code snippet, the exact PSRemotingTransportException stack trace, and mention that it fails specifically on Get-MailboxAutoReplyConfiguration even with small batches of 100 objects.

Seek Assistance on Microsoft Q&A
Support Requirement: Provide a sanitized version of your tenant details and code; never share actual user credentials or plain-text access tokens in public forums.
Free Microsoft Office alternative

Boost Your Daily Productivity with WPS Office

While enterprise IT issues like Exchange Online server errors require specialized administration, your daily document tasks shouldn't be a hassle. WPS Office is a free, lightweight, and user-friendly alternative to Microsoft Office, designed to keep your workflow smooth and efficient.

  1. 1. Download the installer: Visit the official WPS Office website and click the download button for your operating system.
  2. 2. Install the suite: Run the downloaded installer and follow the on-screen instructions to complete the setup.
  3. 3. Open your documents: Launch WPS Office and directly open any existing Microsoft Word, Excel, or PowerPoint files without losing formatting.
Highly compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight software footprint that won't consume excessive system memory or resources.Familiar user interface ensuring a zero-learning-curve migration.Built-in PDF editing, tabbed document viewing, and cloud collaboration tools.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Get-MailboxAutoReplyConfiguration trigger a PSRemotingTransportException?

This typically occurs when the background IIS process handling PowerShell remoting in Exchange Online hits a memory threshold. It is often caused by the heavy XML serialization required to transport complex auto-reply configuration objects over WinRM.

Can I increase the PowerShell memory limit for my Exchange Online tenant?

No, Exchange Online is a managed SaaS environment. Tenants cannot modify the MaxMemoryPerShellMB quota on the server side as they could in on-premises Exchange. You must optimize your client-side scripts to use less memory per session.

How can I avoid memory leaks in my C# PowerShell connector?

Ensure you are explicitly calling runspace.Dispose() and PowerShell.Dispose() in your C# code after executing commands. Relying solely on the .NET garbage collector may lead to intermittent out-of-memory errors and runspace exhaustion during high-frequency API calls.