Configure monitoring for incoming and outgoing file and program activity
Configurer l’analyse de l’activité des fichiers et programmes entrants et sortants
Explanation
This policy setting allows you to configure monitoring for incoming and outgoing files, without having to turn off monitoring entirely. It is recommended for use on servers where there is a lot of incoming and outgoing file activity but for performance reasons need to have scanning disabled for a particular scan direction. The appropriate configuration should be evaluated based on the server role.
Note that this configuration is only honored for NTFS volumes. For any other file system type, full monitoring of file and program activity will be present on those volumes.
The options for this setting are mutually exclusive:
0 = Scan incoming and outgoing files (default)
1 = Scan incoming files only
2 = Scan outgoing files only
Any other value, or if the value does not exist, resolves to the default (0).
If you enable this setting, the specified type of monitoring will be enabled.
If you disable or do not configure this setting, monitoring for incoming and outgoing files will be enabled.
Ce paramètre de stratégie vous permet de configurer l’analyse des fichiers entrants et sortants, sans avoir à désactiver entièrement l’analyse. Son utilisation est recommandée sur les serveurs sur lesquels l’activité des fichiers entrants et sortants est importante mais pour lesquels, pour des raisons de performances, l’analyse doit être désactivée dans une direction d’analyse spécifique. La configuration appropriée doit être évaluée en fonction du rôle de serveur.
Notez que cette configuration n’est respectée que pour les volumes NTFS. Pour tout autre type de système de fichiers, une analyse complète de l’activité des fichiers et programmes est présente sur ces volumes.
Les options pour ce paramètre s’excluent mutuellement :
0 = Analyser les fichiers entrants et sortants (valeur par défaut)
1 = Analyser uniquement les fichiers entrants
2 = Analyser uniquement les fichiers sortants
Toute autre valeur, ou l’absence de valeur, correspond à la valeur par défaut (0).
Si vous activez ce paramètre, le type d’analyse spécifié est activé.
Si vous désactivez ou ne configurez pas ce paramètre, l’analyse des fichiers entrants et sortants est activée.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Real-Time Protection- Value name
RealtimeScanDirection
| 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: WindowsDefender/RealtimeProtection_RealtimeScanDirection
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Real-Time Protection'
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 'RealtimeScanDirection' -Value 1 -Type DWord # assumed value (not defined in the ADMX)
# Configure monitoring for incoming and outgoing file and program activity
# Possible options:
# bi-directional (full on-access) = 0
# scan only incoming (disable on-open) = 1
# scan only outgoing (disable on-close) = 2
Set-ItemProperty -Path $k -Name 'RealtimeScanDirection' -Value 0 -Type DWordDisable
# Disable: WindowsDefender/RealtimeProtection_RealtimeScanDirection
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Real-Time Protection'
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 'RealtimeScanDirection' -Value 0 -Type DWord # assumed value (not defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": WindowsDefender/RealtimeProtection_RealtimeScanDirection
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Real-Time Protection'
Remove-ItemProperty -Path $k -Name 'RealtimeScanDirection' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Configure monitoring for incoming and outgoing file and program activityConfigurer l’analyse de l’activité des fichiers et programmes entrants et sortantsRealtimeProtection_RealtimeScanDirection | Drop-down listenum | RealtimeScanDirection | REG_DWORD | Required · Default choice (UI): #0
|