Define device control policy rules
Définir les règles de stratégie de contrôle des appareils
Explanation
Please follow the device control policy rules xml schema to fill out the policy rules data.
Alternatively you could use a file path containing the XML rules data.
Suivez le schéma XML des règles de stratégie de contrôle d’appareil pour remplir les données des règles de stratégie.
Vous pouvez également utiliser un chemin de fichier contenant les données des règles XML.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Device Control\Policy Rules- 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: WindowsDefender/DeviceControl_PolicyRules
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Device Control\Policy Rules'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Define the policy rules here
Set-ItemProperty -Path $k -Name 'PolicyRules' -Value '<value>' -Type StringDisable
# Disable: WindowsDefender/DeviceControl_PolicyRules
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": WindowsDefender/DeviceControl_PolicyRules
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Device Control\Policy Rules'
Remove-ItemProperty -Path $k -Name 'PolicyRules' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Define the policy rules hereDéfinir les règles de stratégie iciDeviceControl_PolicyRules | Text boxtext | PolicyRules | REG_SZ | Required |