マクロ実行時のスキャンの範囲 のレジストリ値 macroruntimescanscopeユーザーHKCU\software\policies\microsoft\office\16.0\common\security

ポリシー ID
L_MacroRuntimeScanScope
適用対象
ユーザーの構成
サポートされるバージョン
Windows Server 2016 以降または Windows 10 以降
出典
Microsoft 365 Apps / Office Administrative Templates (バージョン 5568.1000)
カテゴリ
Microsoft Office 2016 › セキュリティ設定

レジストリ

macroruntimescanscope

REG_DWORDユーザー
有効時の値
オプションの値に依存
要素
-
オプション
項目保存される値
すべてのドキュメントで無効にする0
信頼度低のドキュメントで有効にする1
すべてのドキュメントで有効にする2
Scan excluding documents marked as trusted by an admin3
.reg · CMD · PowerShell で適用する
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\common\security]

; 選択項目 (1 つだけ使用)
; すべてのドキュメントで無効にする
"macroruntimescanscope"=dword:00000000
; 信頼度低のドキュメントで有効にする
"macroruntimescanscope"=dword:00000001
; すべてのドキュメントで有効にする
"macroruntimescanscope"=dword:00000002
; Scan excluding documents marked as trusted by an admin
"macroruntimescanscope"=dword:00000003
CMD
:: 選択項目 (1 つだけ使用)

:: すべてのドキュメントで無効にする
reg add "HKCU\software\policies\microsoft\office\16.0\common\security" /v "macroruntimescanscope" /t REG_DWORD /d 0 /f
:: 信頼度低のドキュメントで有効にする
reg add "HKCU\software\policies\microsoft\office\16.0\common\security" /v "macroruntimescanscope" /t REG_DWORD /d 1 /f
:: すべてのドキュメントで有効にする
reg add "HKCU\software\policies\microsoft\office\16.0\common\security" /v "macroruntimescanscope" /t REG_DWORD /d 2 /f
:: Scan excluding documents marked as trusted by an admin
reg add "HKCU\software\policies\microsoft\office\16.0\common\security" /v "macroruntimescanscope" /t REG_DWORD /d 3 /f
PowerShell
# 共通: キーを作成
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\common\security' -Force | Out-Null

# 選択項目 (1 つだけ使用)
# すべてのドキュメントで無効にする
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\common\security' -Name 'macroruntimescanscope' -PropertyType DWord -Value 0 -Force | Out-Null
# 信頼度低のドキュメントで有効にする
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\common\security' -Name 'macroruntimescanscope' -PropertyType DWord -Value 1 -Force | Out-Null
# すべてのドキュメントで有効にする
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\common\security' -Name 'macroruntimescanscope' -PropertyType DWord -Value 2 -Force | Out-Null
# Scan excluding documents marked as trusted by an admin
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\common\security' -Name 'macroruntimescanscope' -PropertyType DWord -Value 3 -Force | Out-Null