Specify maximum amount of memory in MB per Shell
Spécifier une quantité maximale de mémoire (en mégaoctets) par environnement
Explanation
This policy setting configures the maximum total amount of memory in megabytes that can be allocated by any active remote shell and all its child processes.
Any value from 0 to 0x7FFFFFFF can be set, where 0 equals unlimited memory, which means the ability of remote operations to allocate memory is only limited by the available virtual memory.
If you enable this policy setting, the remote operation is terminated when a new allocation exceeds the specified quota.
If you disable or do not configure this policy setting, the value 150 is used by default.
Ce paramètre de stratégie configure la quantité totale maximale de mémoire (en méga-octets) pouvant être attribuée par un environnement distant actif et tous ses processus enfants.
N’importe quelle valeur entre 0 et 0x7FFFFFFF peut être définie, où 0 indique une quantité de mémoire illimitée ; en d’autres termes, la capacité des opérations distantes à allouer de la mémoire n’est limitée que par la mémoire virtuelle disponible.
Si vous activez ce paramètre de stratégie, l’opération distante est interrompue dès qu’une nouvelle attribution dépasse le quota spécifié.
Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, la valeur 150 est utilisée par défaut.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WinRM\Service\WinRS- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: WindowsRemoteShell/MaxMemoryPerShellMB
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Service\WinRS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# MaxMemoryPerShellMB
Set-ItemProperty -Path $k -Name 'MaxMemoryPerShellMB' -Value 150 -Type DWord # between 0 and 2147483647Disable
# Disable: WindowsRemoteShell/MaxMemoryPerShellMB
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": WindowsRemoteShell/MaxMemoryPerShellMB
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Service\WinRS'
Remove-ItemProperty -Path $k -Name 'MaxMemoryPerShellMB' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| MaxMemoryPerShellMBMaxMemoryPerShellMB | Numeric boxdecimal | MaxMemoryPerShellMB | REG_DWORD | Min: 0 · Max: 2147483647 · Default (UI): 150 |