Please enable Javascript for better experience...
How to Configure Maximum Powershell Memory (MaxMemoryPerShellMB) in Windows Server
By Pranay Jha | Jun 13, 2016 | In Tips | Total Views [ 1447 ]
Taged In
(0 Like)

Configure Maximum Powershell Memory (MaxMemoryPerShellMB) in Windows Server


Use below Powershell CLI command to configure maximum powershell memory.

PS C:\> sl WSMan:\localhost\Shell

PS WSMan:\localhost\Shell> dir

   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Shell

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   AllowRemoteShellAccess                         true
System.String   IdleTimeout                                    7200000
System.String   MaxConcurrentUsers                             10
System.String   MaxShellRunTime                                2147483647
System.String   MaxProcessesPerShell                           25
System.String   MaxMemoryPerShellMB                            512
System.String   MaxShellsPerUser                               30

PS WSMan:\localhost\Shell> Set-Item .\MaxMemoryPerShellMB 1024


Other PowerCLI commands can also be use to check and configure powershell Memory. Open Powershell CLI. Run below commands.

Get-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB

Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1024


You can also configure powershell Memory through batch command. Open CMD and run below command to configure it.

winrm.cmd set winrm/config/winrs @{MaxMemoryPerShellMB="1024"}


You can also configure MaxMemoryPerShellMB in multiple machine remotely by using below batch command. Open CMD and run below command to configure it.

for /f %%i in (servers.txt) do ( 
echo %%i
psexec \\%%i -s winrm.cmd quickconfig -q
psexec \\%%i -s winrm.cmd set winrm/config/winrs @{MaxMemoryPerShellMB="512"}

Thanks for visiting here. Share this article if you found it useful.
Join Facebook Group
Like Facebook Page
Connect to twitter
Share this on Social Media

About the Author

Pranay Jha
Pranay Jha
Founder, Contributer
Follow me

facebook linkedin twitter G+ VMTN

My name is Pranay Jha, working in IBM as Technical Solution Architect for Virtualization platform. I have been working in IT for near around 11 years. Passionate to get involved as an Independent blogger for my blog I am carrying few industrial certifications as VMware vExpert 2016/2017, VCIX6, VCAP6-DCD, VCAP5-DCD/DCA, VCP6-DCVVCP5-DCV, VCA-Cloud, VCE-CIA, VSP, MCSE, MCITP, MCSA(Messaging). For any query or suggestion, please connect me at Thanks for visiting here.

Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Facebook Likes