{"id":6197,"date":"2023-08-18T14:18:57","date_gmt":"2023-08-18T05:18:57","guid":{"rendered":"\/blog\/?p=6197"},"modified":"2023-09-21T09:26:18","modified_gmt":"2023-09-21T00:26:18","slug":"defender-%ec%98%88%ec%99%b8%ec%b2%98%eb%a6%ac-%eb%aa%a9%eb%a1%9d-%ec%b4%88%ea%b8%b0%ed%99%94-%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=6197","title":{"rendered":"Defender \uc608\uc678\ucc98\ub9ac \ubaa9\ub85d \ucd08\uae30\ud654 \uc2a4\ud06c\ub9bd\ud2b8"},"content":{"rendered":"\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bat\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">powershell -ExecutionPolicy Bypass -File \".\\Clear-WindowsDefenderExcl.ps1\"\n@PAUSE<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># PowerShell script to clear the ExclusionPath, ExclusionProcess, and ExclusionExtension\n# associated with Windows Defender Antivirus\n\n# Start transcript\n$Logs = \"Clear-WindowsDefenderExcl.txt\"\nStart-Transcript $Logs -Append -Force\n\n# Get Windows Defender preferences\n$x = Get-MpPreference\n\n# Get exclusion path\nif ($x.ExclusionPath -ne $NULL) {\n    Write-Host(\"================================================\")\n    Write-Host(\"Removing the following ExclusionPath entries:\")\n    foreach ($i in $x.ExclusionPath) {\n        Remove-MpPreference -ExclusionPath $i\n        Write-Host($i)\n    }\n    Write-Host(\"================================================\")\n    Write-Host(\"Total ExclusionPath entries deleted:\", $x.ExclusionPath.Count)\n}\nelse {\n    Write-Host(\"No ExclusionPath entries present. Skipping...\")\n}\n\n# Get exclusion process\nif ($x.ExclusionProcess -ne $NULL) {\n    Write-Host(\"================================================\")\n    Write-Host(\"Removing the following ExclusionProcess entries:\")\n    foreach ($i in $x.ExclusionProcess) {\n        Remove-MpPreference -ExclusionProcess $i\n        Write-Host($i)\n    }\n    Write-Host(\"================================================\")\n    Write-Host(\"Total ExclusionProcess entries deleted:\", $x.ExclusionProcess.Count)\n}\nelse {\n    Write-Host(\"No ExclusionProcess entries present. Skipping...\")\n}\n\n# Get exclusion extension\nif ($x.ExclusionExtension -ne $NULL) {\n    Write-Host(\"================================================\")\n    Write-Host(\"Removing the following ExclusionExtension entries:\")\n    foreach ($i in $x.ExclusionExtension) {\n        Remove-MpPreference -ExclusionExtension $i\n        Write-Host($i)\n    }\n    Write-Host(\"================================================\")\n    Write-Host(\"Total ExclusionExtension entries deleted:\", $x.ExclusionExtension.Count)\n}\nelse {\n    Write-Host(\"No ExclusionExtension entries present. Skipping...\")\n}\n\n# Summary\nWrite-Host(\"================================================\")\nWrite-Host(\"SUMMARY\")\nWrite-Host($x.ExclusionPath.Count, \"ExclusionPath entries deleted.\")\nWrite-Host($x.ExclusionProcess.Count, \"ExclusionProcess entries deleted.\")\nWrite-Host($x.ExclusionProcess.Count, \"ExclusionExtension entries deleted.\")\nWrite-Host(($x.ExclusionPath.Count + $x.ExclusionProcess.Count + $x.ExclusionExtension.Count), \"Total entries deleted\")\nWrite-Host(\"\")\nWrite-Host(\"Done.\")\nStop-Transcript<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[40],"tags":[],"class_list":["post-6197","post","type-post","status-publish","format-standard","hentry","category-os_win"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6197"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6197\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}