Open in the explorer

Allow Remote Shell Access

Autoriser l’accès aux environnements distants

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Windows Remote Shell FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Environnement distant Windows
Supported on
At least Windows Vista FR: Au minimum Windows Vista
ADMX file
WindowsRemoteShell.admx
Internal name
WindowsRemoteShell/AllowRemoteShellAccess

Explanation

This policy setting configures access to remote shells.

If you enable or do not configure this policy setting, new remote shell connections are accepted by the server.

If you set this policy to ‘disabled’, new remote shell connections are rejected by the server.

French text from Windows 11 26H2

Ce paramètre de stratégie configure l’accès aux environnements distants.

Si vous activez ce paramètre de stratégie ou si vous ne le configurez pas, les nouvelles connexions d’environnement distant sont acceptées par le serveur.

Si vous désactivez ce paramètre de stratégie, les nouvelles connexions d’environnement distant sont rejetées par le serveur.

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WinRM\Service\WinRS
Value name
AllowRemoteShellAccess
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

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/AllowRemoteShellAccess
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Service\WinRS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowRemoteShellAccess' -Value 1 -Type DWord

Disable

# Disable: WindowsRemoteShell/AllowRemoteShellAccess
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Service\WinRS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowRemoteShellAccess' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": WindowsRemoteShell/AllowRemoteShellAccess
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Service\WinRS'
Remove-ItemProperty -Path $k -Name 'AllowRemoteShellAccess' -ErrorAction SilentlyContinue

Availability