共用方式為


使用 Powershell 評估 Microsoft Defender 防病毒軟體

適用於:

在 Windows 10 或更新版本和 Windows Server 2016 或更新版本中,您可以使用 Microsoft Defender 防病毒軟體 (MDAV) 和 Microsoft Defender 惡意探索防護 (Microsoft Defender EG) 所提供的新一代保護功能。

本主題說明如何在 Microsoft Defender AV 和 Microsoft Defender EG 中啟用和測試密鑰保護功能,並提供更多資訊的指引和連結。

建議您使用 此評估 PowerShell 腳本來 設定這些功能,但您可以使用本文件其餘部分所述的 Cmdlet 個別啟用每個功能。

如需 EPP 產品的詳細資訊,請參閱下列產品檔庫:

本文說明 Windows 10 或更新版本和 Windows Server 2016 或更新版本中的組態選項。

如果您有任何關於 AV Microsoft Defender 偵測的問題,或您發現遺漏的偵測,您可以在我們的範例提交說明網站將檔案提交給我們。

使用 PowerShell 啟用功能

本指南提供 Microsoft Defender 防病毒軟體 Cmdlet,以設定您應該用來評估保護的功能。

若要使用這些 Cmdlet:

1.開啟已提升許可權的 PowerShell 實例 (選擇 [以系統管理員身分執行]) 。

2.輸入本指南中所列的命令,然後按 Enter。

您可以使用 Get-MpPreference PowerShell Cmdlet,在開始之前或評估期間檢查所有設定的狀態。

Microsoft Defender AV 表示透過標準 Windows 通知偵測。 您也可以檢閱 Microsoft Defender AV 應用程式中的偵測

Windows 事件記錄檔也會記錄偵測和引擎事件。 如需事件標識碼及其對應動作的清單,請參閱 Microsoft Defender 防病毒軟體事件一文

雲端保護功能

標準定義更新可能需要數小時來準備和傳遞;我們的雲端式保護服務可在數秒內提供此保護。

如需詳細資訊,請參閱透過雲端提供的保護,在 Microsoft Defender 防病毒軟體中使用新一代技術

描述 PowerShell 命令
啟用 Microsoft Defender 雲端以進行近乎實時的保護並增加保護 Set-MpPreference -MAPSReporting Advanced
自動提交範例以增加群組保護 Set-MpPreference -SubmitSamplesConsent Always
一律使用雲端在幾秒內封鎖新的惡意代碼 Set-MpPreference -DisableBlockAtFirstSeen 0
掃描所有下載的檔案和附件 Set-MpPreference -DisableIOAVProtection 0
將雲端區塊層級設定為 「高」 Set-MpPreference -CloudBlockLevel High
將雲端區塊逾時設定為1分鐘 Set-MpPreference -CloudExtendedTimeout 50

實時掃描 (一律開啟保護)

Microsoft Defender AV 會在 Windows 看到檔案時立即掃描檔案,並監視執行中的程式是否有已知或可疑的惡意行為。 如果防病毒軟體引擎發現惡意修改,它會立即封鎖進程或檔案執行。

如需這些選項的詳細資訊,請參閱設定 行為、啟發學習法和實時保護

描述 PowerShell 命令
持續監視檔案和程式的已知惡意代碼修改 Set-MpPreference -DisableRealtimeMonitoring 0
持續監視已知的惡意代碼行為 – 即使在「乾淨」檔案和執行中的程式中 Set-MpPreference -DisableBehaviorMonitoring 0
在看到或執行文稿時立即掃描腳本 Set-MpPreference -DisableScriptScanning 0
在插入或掛接卸載式磁碟驅動器后立即掃描它們 Set-MpPreference -DisableRemovableDriveScanning 0

潛在的垃圾應用程式保護

潛在的垃圾應用程式 是傳統上未分類為惡意的檔案和應用程式。 其中包括常用軟體的第三方安裝程式、廣告插入,以及瀏覽器中的特定工具列類型。

描述 PowerShell 命令
防止灰色軟體、廣告件和其他潛在的垃圾應用程式安裝 Set-MpPreference -PUAProtection Enabled

Email和封存掃描

您可以將 Microsoft Defender 防病毒軟體設定為自動掃描特定類型的電子郵件檔和封存盤 (,例如當 Windows 看到 .zip 檔案時) 。 如需這項功能的詳細資訊,請參閱在 Microsoft Defender 中管理電子郵件掃描一文。

描述 PowerShell 命令
掃描電子郵件檔案和封存 Set-MpPreference -DisableArchiveScanning 0
Set-MpPreference -DisableEmailScanning 0

管理產品和保護更新

一般而言,您每天會收到 Microsoft Defender 來自 Windows Update 的 AV 更新一次。 不過,您可以設定下列選項來增加這些更新的頻率,並確保您的更新在 System Center Configuration Manager、群組原則 或 Intune 中受到管理

描述 PowerShell 命令
每天更新簽章 Set-MpPreference -SignatureUpdateInterval
執行排程掃描之前,請先檢查以更新簽章 Set-MpPreference -CheckForSignaturesBeforeRunningScan 1

進階威脅和惡意探索防護和預防受控資料夾存取

Microsoft Defender 惡意探索防護提供可協助保護裝置免於已知惡意行為和攻擊易受攻擊技術的功能。

描述 PowerShell 命令
防止惡意和可疑的應用程式 (,例如勒索軟體) 使用受控資料夾存取權對受保護的資料夾進行變更 Set-MpPreference -EnableControlledFolderAccess Enabled
使用網路保護封鎖對已知錯誤 IP 位址和其他網路連線的連線 Set-MpPreference -EnableNetworkProtection Enabled
使用惡意探索保護套用一組標準的風險降低措施
https://demo.wd.microsoft.com/Content/ProcessMitigation.xml Invoke-WebRequest -OutFile ProcessMitigation.xml
Set-ProcessMitigation -PolicyFilePath ProcessMitigation.xml
使用受攻擊面縮小來封鎖已知的惡意攻擊媒介 Add-MpPreference -AttackSurfaceReductionRules_Ids 56a863a9-875e-4185-98a7-b882c64b5ce5 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 7674ba 52-37eb-4a4f-a9a1-f0f9a1619a2c -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EfC-AADCAD5F3C50688A -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids BE9BA2D9-53EA-4CDC-84E5- 9B1EEEE46550 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 01443614-CD74-433A-B99E2ECDC07BFC25 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 5BEB7EFE-FD9A-4556801D275E5FFC04CC -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D3E037E1-3EB8-44C8-A 917- 57927947596D -AttackSurfaceReductionRules_Actions啟用
Add-MpPreference -AttackSurfaceReductionRules_Ids 3B576869-A4EC-4529-8536- B80A7769E899 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 75668C1F-73B5-4CF0-BB93- 3ECF5CB7CC84 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 26190899-1602-4 9e8-8b27-eb1d0a1ce869 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids e6db77e5-3df2-4cf1-b95a-636979351e5b -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D1E49AAC-8F56-4280-B9BA993A6D77406C -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 33ddedf1-c6e0-47cb-833e-de6133960387 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids B2B3F03D-6A65-4F7B-A9C7- 1C7EF74A9BA4 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids c0033c00-d16d-4114-a5a0-dc9b3a7d2ceb -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids a8f5898e-1dc8-49a 9-9878-85004b8a61e6 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 92E97FA1-2EDF-4476-BDD6- 9DD0B4DDDC7B -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids C1DB55AB-C21A-4637-BB3FA12568109D35 -AttackSurfaceReductionRules_Actions Enabled

某些規則可能會封鎖您在組織中可接受的行為。 在這些情況下,請將規則從 [已啟用] 變更為 [稽核],以防止不必要的區塊。

按兩下 Microsoft Defender離線掃描

Microsoft Defender 離線掃描是特製化工具,隨附 Windows 10 或更新版本,可讓您將機器開機到一般操作系統以外的專用環境。 它特別適用於強大的惡意代碼,例如 rootkit。

如需此功能運作方式的詳細資訊,請參閱 Microsoft Defender Offline

描述 PowerShell 命令
確定通知可讓您將電腦開機到特製化的惡意代碼移除環境 Set-MpPreference -UILockdown 0

資源

本節列出許多可協助您評估 Microsoft Defender 防病毒軟體的資源。