tjhack
tjhack

Reputation: 1032

Starting application pool concurrently causes error related to maximum number of concurrent shells

I have a powershell script which can run asynchorusly to start multiple application pools.

But when i have a certain amount of app pools to start it throws the following error:

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: [ServerX] Connecting to remote server XXX failed with the following error message : The WS-Management service cannot process the request. This user has exceeded the maximum number of concurrent shells allowed for this plugin. Close at least one open shell or raise the plugin quota for this user. For more information, see the about_Remote_Troubleshooting Help topic.

The maximum shells per user is 10000.

It seems that there is more happening beneath the hood when appcmd runs but not sure how i can get around this issue

Any advice would be great

Below is the winrs config

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                            1024
System.String   MaxShellsPerUser                               10000

Upvotes: 2

Views: 2527

Answers (1)

Nathan Rice
Nathan Rice

Reputation: 3111

cd WSMan:\localhost\Shell
Set-Item .\MaxProcessesPerShell 10000

Upvotes: 2

Related Questions