Require domain users to elevate when setting a network's location
Exiger des utilisateurs du domaine qu'ils procèdent à une élévation lors de la définition d'un emplacement réseau
Explanation
This policy setting determines whether to require domain users to elevate when setting a network's location.
If you enable this policy setting, domain users must elevate when setting a network's location.
If you disable or do not configure this policy setting, domain users can set a network's location without elevating.
Ce paramètre de stratégie détermine si les utilisateurs doivent procéder à une élévation lors de la définition d'un emplacement réseau.
Si vous activez ce paramètre de stratégie, les utilisateurs du domaine doivent procéder à une élévation lorsqu'ils définissent un emplacement réseau.
Si vous désactivez ou ne configurez pas ce paramètre, les utilisateurs du domaine peuvent définir un emplacement réseau sans procéder à une élévation.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Network Connections- Value name
NC_StdDomainUserSetLocation
| 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: NetworkConnections/NC_StdDomainUserSetLocation
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Network Connections'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NC_StdDomainUserSetLocation' -Value 1 -Type DWordDisable
# Disable: NetworkConnections/NC_StdDomainUserSetLocation
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Network Connections'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NC_StdDomainUserSetLocation' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": NetworkConnections/NC_StdDomainUserSetLocation
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Network Connections'
Remove-ItemProperty -Path $k -Name 'NC_StdDomainUserSetLocation' -ErrorAction SilentlyContinue