Microsoft released several security updates for Microsoft Exchange Server to address vulnerabilities that have been…
Pagefile Exchange 2019 best practice PowerShell
How to configure the pagefile in Exchange Server 2019 through PowerShell? You can configure the pagefile in two ways. One of them is through Exchange Server GUI. The other way is with PowerShell. If you do it through the GUI, you need to do the math first. After that, you need to edit the pagefile. What if you don’t want to do the math and don’t like to edit the pagefile through the Exchange Server GUI? For example, you want it to run on many Exchange Servers. Editing every Exchange Server through the GUI will take time. What if you can run a script that will do it all? PowerShell to the rescue.
Table of contents
Before you start
If you want to learn more and set the pagefile on an Exchange Server 2013/2016, read the following articles:
Pagefile information
The pagefile sizing changed in Exchange Server 2019 compared to Exchange Server 2013/2016.
Exchange 2019
Pagefile sizing is now 25% of total RAM (maximum of 64GB). The maximum memory is 256GB.
Exchange 2016
Pagefile sizing is RAM + 10MB (maximum of 32GB RAM + 10MB). The maximum memory is 192GB.
Exchange 2019 pagefile examples
If you want to configure your Exchange Server 2019 pagefile. Here are some examples:
RAM | Pagefile |
---|---|
64GB | 16GB |
96GB | 24GB |
128GB | 32GB |
160GB | 40GB |
192GB | 48GB |
256GB | 64GB |
Microsoft recommends 128GB RAM for the Mailbox Role and 6GB RAM for the Edge Transport Role.
Configure Exchange Server pagefile through PowerShell
I came across the following post by MVP Damian Scoles. He made a script to configure the pagefile of the Exchange Server 2019. Download the Set-PagefileExchange2019.ps1 PowerShell script. Save the script in your c:\scripts\ folder. Run the PowerShell script as administrator. If you like, you can copy the script below and paste it in PowerShell. The script will remove the old pagefile and configure a new pagefile with the correct size.
Set-CimInstance -Query "Select * from win32_computersystem" -Property @{automaticmanagedpagefile = "False" }
$RamInMb = (Get-CIMInstance -computername $name -Classname win32_physicalmemory -ErrorAction Stop | measure-object -property capacity -sum).sum / 1MB
$ExchangeRAM = $RAMinMb * 0.25
Set-CimInstance -Query "Select * from win32_PageFileSetting" -Property @{InitialSize = $ExchangeRAM; MaximumSize = $ExchangeRAM }
It’s a great script and does the job. If you have many Exchange Servers and want to change the pagefile, make your life easier, and run the script. Will you be using the PowerShell script in your Exchange Server 2019? I recommend using the script.
Keep reading: Install Exchange Server 2016 step by step with GUI »
Conclusion
You learned how to change the Exchange Server 2019 pagefile through PowerShell. Run the script, and it will configure the pagefile on the Exchange Server 2019. Don’t forget to reboot after the change! This script should only run in Exchange Server 2019. Not on other Exchange Server versions.
Did you enjoy this article? You may also like Certificate warning during or after a new Exchange Server installation. Don’t forget to follow us and share this article.
This Post Has 0 Comments