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 [ 1147 ]
Taged In
(0 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.
Join Facebook Group https://www.facebook.com/groups/VMwareInsight/
Like Facebook Page https://www.facebook.com/VMwareInsight/
Connect to twitter https://twitter.com/VMwareInsight
Share this on Social Media

About the Author

Pranay Jha
Pranay Jha
Founder, Contributer VMwareInsight.com
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 10 years. Passionate to get involved as an Independent blogger for my blog http://vmwareinsight.com. I am VMware vExpert 2016/2017, VCAP5-DCD/DCA, VCP5-DCV, VCA-Cloud, VCE-CIA, MCSE, MCITP, MCSA(Messaging). For any query or suggestion, please connect me at pranay1988jha@gmail.com. Thanks for visiting here.

 
Please SignUp/Login to comment...

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