同时启动应用程序池会导致与最大并发 shell 数量相关的错误

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

我有一个 powershell 脚本,它可以 运行 异步启动多个应用程序池。

但是当我有一定数量的应用程序池启动时它会抛出以下错误:

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.

每个用户的最大 shell 为 10000。

当 appcmd 运行s 时,幕后似乎发生了更多事情,但不确定如何解决这个问题

任何建议都很好

下面是winrs配置

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
cd WSMan:\localhost\Shell
Set-Item .\MaxProcessesPerShell 10000