Ouvrir dans l'explorateur

Macro Runtime Scan Scope

Cette stratégie n'a pas de traduction française dans les modèles de l'éditeur ; le texte original est en anglais.

Type
Utilisateur
Chemin GPO
Configuration utilisateur › Stratégies › Modèles d'administration › Microsoft Office 2016 › Paramètres de sécurité EN : User Configuration › Policies › Administrative Templates › Microsoft Office 2016 › Security Settings
Pris en charge sur
At least Windows Server 2016, Windows 10
Fichier ADMX
office16.admx
Nom interne
office16/L_MacroRuntimeScanScope

Explication

This policy setting specifies the behavior for both the VBA and Excel 4.0 (XLM) runtime scan features. Multiple Office apps support VBA macros, but XLM macros are only supported by Excel. Macros can only be scanned if the anti-virus software registers as an Antimalware Scan Interface (AMSI) provider on the device.

If you enable this policy setting, you can choose from the following options to determine the macro runtime scanning behavior:

- Disable for all files (not recommended): If you choose this option, no runtime scanning of enabled macros will be performed.

- Enable for low trust files: If you choose this option, runtime scanning will be enabled for all files for which macros are enabled, except for the following files:
- Files opened while macro security settings are set to “Enable All Macros”
- Files opened from a Trusted Location
- Files that are Trusted Documents
- Files that contain VBA that is digitally signed by a Trusted Publisher

- Enable for all files: If you choose this option, then low trust files are not excluded from runtime scanning.

- Enable for files, excluding documents marked as trusted by an admin: If you choose this option, runtime scanning will be enabled for all files for which macros are enabled, except for the following files:
- Files opened from a Trusted Location
- Files that contain VBA that is digitally signed by a Trusted Publisher

The VBA and XLM runtimes report to an antivirus system certain high-risk code behaviors the macro is about to execute. This allows the antivirus system to indicate whether or not the macro behavior is malicious. If the behavior is determined to be malicious, the Office application closes the session and the antivirus system can quarantine the file. If the behavior is non-malicious, the macro execution proceeds.

Note: When macro runtime scanning is enabled, the runtime performance of affected VBA projects and XLM sheets may be reduced.

If you disable this policy setting, no runtime scanning of enabled macros will be performed.

If you don’t configure this policy setting, “Enable for low trust files” will be the default setting.

Note: This policy setting only applies to subscription versions of Office, such as Microsoft 365 Apps for enterprise.

Registre

HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\common\security
Nom de la valeur
non défini dans l'ADMX

Valeurs d'activation / désactivation : non défini dans l'ADMX (voir les options ci-dessous).

PowerShell

Commandes PowerShell qui écrivent dans le registre ce que la stratégie écrirait. Les valeurs entre chevrons (<…>) sont à remplacer.

Écrire directement dans le registre contourne la stratégie de groupe : si une GPO gère cette valeur, elle sera réécrite au prochain gpupdate ; sinon la valeur reste en place (effet « tatouage »). Préférez une GPO ou, en local, LGPO.exe. Exécutez PowerShell en administrateur pour HKLM. Certaines stratégies demandent un redémarrage ou gpupdate /force.

Activer

# Activer : office16/L_MacroRuntimeScanScope
$k = 'HKCU:\software\policies\microsoft\office\16.0\common\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
#
# Options possibles :
#   Disable for all documents = 0
#   Enable for low trust documents = 1
#   Enable for all documents = 2
#   Scan excluding documents marked as trusted by an admin = 3
Set-ItemProperty -Path $k -Name 'macroruntimescanscope' -Value 0 -Type DWord

Désactiver

# Désactiver : office16/L_MacroRuntimeScanScope
# Aucune valeur n'est écrite à l'état « Désactivé » (rien de défini dans l'ADMX)

Revenir à « Non configuré »

# Revenir à « Non configuré » : office16/L_MacroRuntimeScanScope
$k = 'HKCU:\software\policies\microsoft\office\16.0\common\security'
Remove-ItemProperty -Path $k -Name 'macroruntimescanscope' -ErrorAction SilentlyContinue

Options (1)

LibelléContrôleValeur de registreType REGContraintes / détails
L_MacroRuntimeScanScopeEnumListe déroulanteenummacroruntimescanscopeREG_DWORD
Choix par défaut (interface) : n° 0
LibelléValeur
Disable for all documentsREG_DWORD = 0
Enable for low trust documentsREG_DWORD = 1
Enable for all documentsREG_DWORD = 2
Scan excluding documents marked as trusted by an adminREG_DWORD = 3

Application

Microsoft 365 Apps / Office (Microsoft) — modèles de novembre 2026

Modèles officiels téléchargés le 12 novembre 2026.