Prevent the computer from joining a homegroup
Empêcher l’ordinateur de rejoindre un groupe résidentiel
Explanation
This policy setting specifies whether users can add computers to a homegroup. By default, users can add their computer to a homegroup on a private network.
If you enable this policy setting, users cannot add computers to a homegroup. This policy setting does not affect other network sharing features.
If you disable or do not configure this policy setting, users can add computers to a homegroup. However, data on a domain-joined computer is not shared with the homegroup.
This policy setting is not configured by default.
You must restart the computer for this policy setting to take effect.
Ce paramètre de stratégie indique si les utilisateurs peuvent ajouter des ordinateurs à un groupe résidentiel. Par défaut, les utilisateurs peuvent ajouter leur ordinateur à un groupe résidentiel sur un réseau privé.
Si vous activez ce paramètre de stratégie, les utilisateurs ne peuvent pas ajouter d’ordinateur à un groupe résidentiel. Ce paramètre de stratégie n’a aucune incidence sur les autres fonctionnalités de partage réseau.
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les utilisateurs peuvent ajouter des ordinateurs à un groupe résidentiel. Toutefois, les données provenant d’un ordinateur joint à un domaine ne sont pas partagées avec le groupe résidentiel.
Ce paramètre de stratégie n’est pas configuré par défaut.
Vous devez redémarrer l’ordinateur pour que ce paramètre de stratégie soit pris en compte.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\HomeGroup- Value name
DisableHomeGroup
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_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: Sharing/DisableHomeGroup
$k = 'HKLM:\Software\Policies\Microsoft\Windows\HomeGroup'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DisableHomeGroup' -Value 1 -Type DWordDisable
# Disable: Sharing/DisableHomeGroup
$k = 'HKLM:\Software\Policies\Microsoft\Windows\HomeGroup'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DisableHomeGroup' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Sharing/DisableHomeGroup
$k = 'HKLM:\Software\Policies\Microsoft\Windows\HomeGroup'
Remove-ItemProperty -Path $k -Name 'DisableHomeGroup' -ErrorAction SilentlyContinue