Custom Commands
Commandes personnalisées
Explanation
Specifies commands configured by the administrator for custom logging. These commands will run in addition to default log commands.
Indique les commandes configurées par l’administrateur pour la journalisation personnalisée. Ces commandes s’exécutent en plus des commandes de journalisation par défaut.
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkConnectivityAssistant\CustomCommands- 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: nca/CustomCommands
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\NetworkConnectivityAssistant\CustomCommands'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# CustomCommands
$values = @('<value1>', '<value2>') # Replace the values with your own
foreach ($v in $values) { Set-ItemProperty -Path $k -Name $v -Value $v -Type String }Disable
# Disable: nca/CustomCommands
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": nca/CustomCommands
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\NetworkConnectivityAssistant\CustomCommands'
# names to adapt
# Remove-ItemProperty -Path $k -Name '<name1>' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| CustomCommandsCustomCommands_Control | List (table)list | SOFTWARE\Policies\Microsoft\Windows\NetworkConnectivityAssistant\CustomCommandsNumbered values (1, 2, 3…) · additive | REG_SZ (values under the key) |