Trusted Hosts
Hôtes approuvés
Explanation
This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses the list specified in TrustedHostsList to determine if the destination host is a trusted entity.
If you enable this policy setting, the WinRM client uses the list specified in TrustedHostsList to determine if the destination host is a trusted entity. The WinRM client uses this list when neither HTTPS nor Kerberos are used to authenticate the identity of the host.
If you disable or do not configure this policy setting and the WinRM client needs to use the list of trusted hosts, you must configure the list of trusted hosts locally on each computer.
Ce paramètre de stratégie permet de définir si le client Gestion à distance de Windows (WinRM) utilise la liste spécifiée dans TrustedHostsList afin de déterminer si l’hôte de destination est une entité approuvée.
Si vous activez ce paramètre de stratégie, le client WinRM utilise la liste spécifiée dans TrustedHostsList afin de déterminer si l’hôte de destination est une entité approuvée. Le client WinRM utilise cette liste lorsque ni HTTPS ni Kerberos ne sont utilisés pour authentifier l’identité de l’hôte.
Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, et si le client WinRM a besoin d’utiliser la liste des hôtes approuvés, vous devez configurer la liste des hôtes approuvés localement sur chaque ordinateur.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WinRM\Client- Value name
TrustedHosts
| State | Value written |
|---|---|
| Enabled | not defined in the ADMX (see the options below) |
| Disabled | 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.
The ADMX does not specify the value written when enabled; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled). The commands below use 1/0 as an assumption.
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: WindowsRemoteManagement/TrustedHosts
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Client'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'TrustedHosts' -Value 1 -Type DWord # assumed value (not defined in the ADMX)
# TrustedHostsList
Set-ItemProperty -Path $k -Name 'TrustedHostsList' -Value '<value>' -Type StringDisable
# Disable: WindowsRemoteManagement/TrustedHosts
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Client'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'TrustedHosts' -Value 0 -Type DWord # assumed value (not defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": WindowsRemoteManagement/TrustedHosts
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WinRM\Client'
Remove-ItemProperty -Path $k -Name 'TrustedHosts' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'TrustedHostsList' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| TrustedHostsList:TrustedHostsList :TrustedHosts_List | Text boxtext | TrustedHostsList | REG_SZ | Max length: 1024 |