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 [ 17414 ]
Taged In
(1 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.
Like Facebook Page
Connect to twitter
Subscribe my Channel
Connect over Linkedin
Share this on Social Media

About the Author

Pranay Jha
Pranay Jha
Founder, Contributer

Public profile: user/profile/99900000

Follow me

facebook linkedin twitter G+ VMTN youtube

Thank you for visiting my profile. I am Pranay Jha, bring along a total of 11+ years of extensive experience with me in Information Technology sector for organizations from small business to large enterprises, wherein my current assignment I am associated with IBM as a Technical Solution Architect for Virtualization platform. I am vExpert x 3 (16/17/18), VCIX-DCV, VCAP5/6-DCD, VCAP5-DCA, VCP7-CMA, VCP5/6-DCV, VCA-DCV, VCA-Cloud, VSP, VCE-CIA, MCITP, MCSE, MCSA(Messaging). I am also an Independent blogger and founder of and I can be reached via email at or Direct Message via Contact Us form.

Please SignUp/Login to comment...

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