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 [ 29528 ]
Taged In
(2 Like)
Rate


Configure Maximum Powershell Memory (MaxMemoryPerShellMB) in Windows Server

Method#1

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

Method#2

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

Method#3

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"}

Method#4

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 https://www.facebook.com/VMwareInsight/
Connect to twitter https://twitter.com/imPranayK
Subscribe my Channel https://www.youtube.com/vmwareinsight
Connect over Linkedin https://in.linkedin.com/in/impranayk
Share this on Social Media

About the Author

Pranay Jha
Pranay Jha
Founder, Contributer VMwareInsight.com

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 http://vmwareinsight.com and https://cloudpathshala.com. I can be reached via email at pranay1988jha@gmail.com or Direct Message via Contact Us form.

 
Please SignUp/Login to comment...

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