<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Parvez Gazi</title>
    <description>The latest articles on DEV Community by Parvez Gazi (@parvez_gazi).</description>
    <link>https://dev.to/parvez_gazi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252233%2F395c7470-8389-4e7e-9706-53fd8534ebb0.png</url>
      <title>DEV Community: Parvez Gazi</title>
      <link>https://dev.to/parvez_gazi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/parvez_gazi"/>
    <language>en</language>
    <item>
      <title>Why PowerShell Mailbox Exports Crawl at 1 GB/Hour (And How We Solved It)</title>
      <dc:creator>Parvez Gazi</dc:creator>
      <pubDate>Wed, 18 Nov 2026 16:30:29 +0000</pubDate>
      <link>https://dev.to/parvez_gazi/why-powershell-mailbox-exports-crawl-at-1-gbhour-and-how-we-solved-it-2mi5</link>
      <guid>https://dev.to/parvez_gazi/why-powershell-mailbox-exports-crawl-at-1-gbhour-and-how-we-solved-it-2mi5</guid>
      <description>&lt;p&gt;If you have ever managed an Exchange Online or Microsoft 365 environment, you know this exact frustration: &lt;/p&gt;

&lt;p&gt;A legal request or a departing executive requires an immediate backup of an 80 GB mailbox. You open PowerShell, fire up the standard export command, and wait:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;MailboxExportRequest&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Mailbox&lt;/span&gt; &lt;span class="s2"&gt;"executive@company.com"&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;FilePath&lt;/span&gt; &lt;span class="s2"&gt;"\\backup\pst\archive.pst"&lt;/span&gt;
&lt;span class="c1"&gt;# Status: Queued... Processing... StalledDueToTarget_DiskLatency (ETA: 40+ Hours)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or worse, if you try writing a custom script using Microsoft Graph API, your console gets hit with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt; &lt;span class="mi"&gt;429&lt;/span&gt; &lt;span class="nc"&gt;Too&lt;/span&gt; &lt;span class="nc"&gt;Many&lt;/span&gt; &lt;span class="nc"&gt;Requests&lt;/span&gt;
&lt;span class="nc"&gt;Retry&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;After&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;
&lt;span class="no"&gt;X&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;MS&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Throttle&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ApplicationThrottling&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two days later, the export is still crawling at roughly 1.1 GB per hour. If the network drops at 95%, you often have to start all over again.&lt;/p&gt;

&lt;p&gt;Here is an honest look at why Microsoft intentionally throttles these scripts, what happens behind the scenes, and how offline standalone processing completely changes the math.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Real Reason Behind the Crawl: Token Buckets
&lt;/h3&gt;

&lt;p&gt;Microsoft 365 is a shared multi-tenant cloud. To prevent one heavy backup script from slowing down mailbox servers for other companies on the same infrastructure, Microsoft enforces strict throttling layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Graph / EWS Token Bucket:&lt;/strong&gt; Every tenant gets a strict request bucket. Reading basic message headers costs 1 token, but pulling attachments costs 5 to 15 tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency Caps:&lt;/strong&gt; Standard administrative accounts are limited to only 4 concurrent worker threads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disk Latency Back-off:&lt;/strong&gt; When Microsoft's internal datacenter disks detect write latency, your export job gets paused automatically.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If a mailbox has 90,000 emails, your script needs over 250,000 tokens. When tokens run out, your script spends most of its time waiting on &lt;code&gt;Retry-After&lt;/code&gt; sleep timers.&lt;/p&gt;




&lt;h3&gt;
  
  
  What About Microsoft Purview eDiscovery?
&lt;/h3&gt;

&lt;p&gt;Many IT admins switch to the Compliance Portal (eDiscovery Content Search) to avoid PowerShell scripts. While it gives you a browser interface, it introduces different headaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It splits large mailboxes into multiple fragmented &lt;code&gt;.zip&lt;/code&gt; containers.&lt;/li&gt;
&lt;li&gt;Custom user categories, flags, and color tags often get stripped during raw MIME export.&lt;/li&gt;
&lt;li&gt;If a 100 GB download fails near the end, there is no resume button—you restart from item #0.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For small mailboxes under 5 GB, native eDiscovery or standard PowerShell scripts are completely fine (we wrote a detailed &lt;a href="https://prismmigration.com/blog/export-office-365-mailbox-to-pst-powershell" rel="noopener noreferrer"&gt;step-by-step PowerShell export guide&lt;/a&gt; if you need the manual commands). &lt;/p&gt;

&lt;p&gt;But for massive archives, running everything over the wire is simply the wrong architecture.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Alternative: Local-First Standalone Extraction
&lt;/h3&gt;

&lt;p&gt;To solve this speed barrier, we took a completely different engineering approach at &lt;a href="https://prismmigration.com" rel="noopener noreferrer"&gt;Prism Migration&lt;/a&gt;. Instead of relying on slow cloud queues or requiring a local copy of Microsoft Outlook to be open, we built a standalone 64-bit engine designed for direct, offline processing.&lt;/p&gt;

&lt;p&gt;Here is how local offline processing bypasses the cloud bottlenecks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Local Binary Deserialization:&lt;/strong&gt; Instead of relying on Outlook's MAPI subsystem, tools like the &lt;a href="https://prismmigration.com/products/pst-converter-tool" rel="noopener noreferrer"&gt;PST Converter Tool&lt;/a&gt; read and reconstruct Outlook PST files directly from disk. It parses the internal binary trees using 64-bit multi-threading without touching cloud throttle limits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQLite Checkpointing:&lt;/strong&gt; Every message processed is recorded in a local SQLite database with write-ahead logging. If your machine reboots or the network interrupts, it resumes exactly where it stopped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full Header &amp;amp; Hash Integrity:&lt;/strong&gt; Email metadata (RFC 5322), folder trees, read/unread flags, and cryptographic SHA-256 hashes are calculated locally. This provides a dispute-ready audit trail for legal compliance.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Real-World Speed Comparison
&lt;/h3&gt;

&lt;p&gt;We tested an enterprise mailbox containing &lt;strong&gt;64.8 GB of data (112,400 messages and attachments)&lt;/strong&gt; across three methods:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Average Speed&lt;/th&gt;
&lt;th&gt;Total Time&lt;/th&gt;
&lt;th&gt;Throttling Errors&lt;/th&gt;
&lt;th&gt;Resumable?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PowerShell Script&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~1.1 GB / hr&lt;/td&gt;
&lt;td&gt;~58 Hours&lt;/td&gt;
&lt;td&gt;400+ (&lt;code&gt;HTTP 429&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Purview eDiscovery&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~2.4 GB / hr&lt;/td&gt;
&lt;td&gt;~27 Hours&lt;/td&gt;
&lt;td&gt;Silent Stalls&lt;/td&gt;
&lt;td&gt;Restart Needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Local Standalone Engine&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;22.5 GB / hr&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~2 Hours 50 Mins&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0 (Zero)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1-Click Exact Resume&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Takeaway for IT Admins
&lt;/h3&gt;

&lt;p&gt;If you are dealing with a routine, single-user mailbox backup, Microsoft's built-in tools are adequate if you have the patience to let them run overnight.&lt;/p&gt;

&lt;p&gt;However, if you are migrating terabytes of archived mail, handling legal discovery, or converting PST archives to open formats like MBOX or PDF, do not fight Microsoft's cloud throttles. Bringing the data local and processing it with a dedicated offline engine saves dozens of hours of wasted script-monitoring.&lt;/p&gt;

&lt;p&gt;Have you run into Exchange Online throttling on your exports? What workarounds are you currently using in your environment?&lt;/p&gt;

</description>
      <category>sysadmin</category>
      <category>devops</category>
      <category>cloud</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
