{"id":1227,"date":"2026-11-25T03:59:34","date_gmt":"2026-11-25T03:59:34","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=1227"},"modified":"2026-11-25T03:59:34","modified_gmt":"2026-11-25T03:59:34","slug":"windows-defender-exclusions-sql-iis-workloads","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/","title":{"rendered":"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To"},"content":{"rendered":"<div style=\"padding:20px\">\n<p>The two articles already on the site measure what Defender costs and which rules stay safe to write. This one goes after a different question: which exclusions are worth the risk because a specific workload cannot function without them, and which popular ones quietly remove the only layer catching a compromised web shell or a restored malicious database file.<\/p>\n<h2>Start with the folder map, not with a list from a blog<\/h2>\n<p>Every exclusion set depends on where the workload actually writes. On a default IIS host that means <code>%SystemRoot%\\System32\\inetsrv<\/code>, the site root under <code>C:\\inetpub<\/code>, ASP.NET temporary compilation folders under <code>C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Temporary ASP.NET Files<\/code>, and the IIS compression and log directories. On SQL Server it means the data, log, backup and <code>Backup\\Log<\/code> folders, plus <code>SQLServer\\MSAS*\\OLAP\\Log<\/code> if Analysis Services runs on the same box.<\/p>\n<p>Confirm the real paths before typing anything into policy. <code>SELECT SERVERPROPERTY('InstanceDefaultDataPath')<\/code> and <code>SELECT SERVERPROPERTY('InstanceDefaultLogPath')<\/code> return the live locations, and <code>Get-WebFilePath<\/code> from the WebAdministration module resolves an IIS site name to its physical directory. An exclusion pointed at a path that does not exist costs nothing and protects nothing.<\/p>\n<h2>The IIS set that is genuinely worth adding<\/h2>\n<p>Add the inetsrv directory, the ASP.NET temporary files folder, and the HTTP compression cache. Add the site root only if the application writes to disk on a hot path \u2014 uploaded images, generated PDFs, cache files dropped in <code>App_Data<\/code>. A plain MVC or Web API site that only reads its assemblies does not need the whole <code>inetpub<\/code> tree excluded, and the earlier piece on <a href=\"https:\/\/windows-vps.org\/\">Windows VPS hosting<\/a> covers why directory scope matters more than the number of entries.<\/p>\n<p>The folders that should never appear in this list are the static content root of an application that accepts uploads, and any directory where compiled output lands before the app pool loads it. Excluding an upload directory hands an attacker a clean place to store a web shell; Windows will not scan the file that gets written there, and the next request will happily execute it.<\/p>\n<h2>SQL Server folders: where the exclusion stops being optional<\/h2>\n<p>A SQL data file is written in 8 KB pages, constantly, with a predictable access pattern. Real-time scanning of an MDF or LDF file adds measurable latency to every checkpoint flush and every log write, and it buys nothing \u2014 Defender cannot meaningfully inspect a binary page structure. Exclude the data and log directories, the backup directory, and the SQL Server <code>Binn<\/code> folder. The documented Microsoft guidance still stands: use the file or folder path, not the process name.<\/p>\n<p>Process exclusions for <code>sqlservr.exe<\/code> are the one step people take too far. Excluding the process means every file SQL Server touches is unscanned, including any file it reads through <code>OPENROWSET<\/code> or a linked server import. If the instance ever loads a spreadsheet from an untrusted share, that is an open pipe. Folder exclusions give the same performance result with a tighter blast radius.<\/p>\n<h2>The exclusions people add that should be removed<\/h2>\n<p>Whole-drive exclusions like <code>D:\\<\/code> on a data volume show up in nearly every template. They are the fastest way to silence a CPU problem and the slowest way to find out that a restored backup contained something live. The same applies to excluding <code>.zip<\/code>, <code>.html<\/code> or <code>.js<\/code> extensions globally \u2014 a very common move after a false positive \u2014 which turns off scanning for the exact file types most web attacks use.<\/p>\n<p>Extension exclusions are per-site decisions, not per-server decisions. If one application&#8217;s deploy pipeline drops a large archive on a schedule, exclude the drop folder, not the extension. Keep a written record of why each entry exists, because the audit question six months later is always &#8220;who added this and what breaks if we remove it.&#8221;<\/p>\n<h2>Watch what happens after you apply them<\/h2>\n<p>Measure before and after with the same baseline. <code>Get-MpComputerStatus<\/code> shows whether real-time protection is active, and <code>Get-MpPreference | Select ExclusionPath, ExclusionExtension, ExclusionProcess<\/code> prints exactly what is in force \u2014 useful because a group policy can add entries you never typed. For scan cost, <code>Get-WinEvent -LogName \"Microsoft-Windows-Windows Defender\/Operational\" -MaxEvents 50<\/code> returns the scan start and stop events with durations.<\/p>\n<p>Expect most of the benefit on a database host and very little on a static IIS box. If removing a file exclusion does not change scan duration in a measurable way, put it back \u2014 an exclusion that buys nothing is pure downside.<\/p>\n<h2>Pair every exclusion with a compensating control<\/h2>\n<p>An exclusion is a gap, so the gap needs a different sensor. On IIS that means request filtering rules in <code>applicationHost.config<\/code>, file write restrictions on the app pool identity, and a scheduled full scan that does cover the excluded path during a maintenance window. On SQL Server it means a login audit and a restricted set of accounts with <code>sysadmin<\/code>, because a database host rarely gets compromised through a binary on disk.<\/p>\n<p>Two registry-backed Defender settings matter here. <code>HKLM\\SOFTWARE\\Microsoft\\Windows Defender\\Exclusions\\Paths<\/code> holds the live list, and <code>HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Exclusions\\Paths<\/code> is where policy writes go. When the two disagree, policy wins and the local entry disappears from the effective set \u2014 a frequent cause of &#8220;my exclusion vanished after a reboot.&#8221;<\/p>\n<h2>Audit the list on a schedule and keep it short<\/h2>\n<p>Review the exclusion set every quarter, or after every major application deployment. Anything added for a migration that finished in the spring should be gone by autumn. Two questions per entry: does the workload still need it, and would removing it cause a visible problem in the next 24 hours. If the answer to the second question is no, remove it.<\/p>\n<p>Keep the list under fifteen entries on a typical combined IIS and SQL host. A short list is auditable, faster to reason about during an incident, and far less likely to contain a path that was spelled correctly in 2023 and points somewhere dangerous now. If the server needs more than that, the workload layout is probably the thing to fix rather than the antivirus configuration.<\/p>\n<p>The whole exercise sits on top of a stable baseline you control. On a <a href=\"https:\/\/windows-vps.org\/\">Windows VPS<\/a> where you own the admin account, you can inspect every folder, print the effective exclusion list, and change it back the moment a measurement disagrees \u2014 which is the only way to run this comparison honestly.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Which Defender folder and process exclusions an IIS and SQL Server host actually needs, which popular ones remove your last line of defence, and how to audit the list.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1227","post","type-post","status-publish","format-standard","hentry","category-reviews"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To - Windows VPS Blog<\/title>\n<meta name=\"description\" content=\"Which Defender folder and process exclusions an IIS and SQL Server host actually needs, which popular ones remove your last line of defence, and how to audit the list.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To\" \/>\n<meta property=\"og:description\" content=\"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-25T03:59:34+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@myxiechengxuan\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/\",\"name\":\"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-11-25T03:59:34+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"description\":\"Which Defender folder and process exclusions an IIS and SQL Server host actually needs, which popular ones remove your last line of defence, and how to audit the list.\",\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\",\"https:\/\/x.com\/myxiechengxuan\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To - Windows VPS Blog","description":"Which Defender folder and process exclusions an IIS and SQL Server host actually needs, which popular ones remove your last line of defence, and how to audit the list.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/","og_locale":"en_US","og_type":"article","og_title":"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To","og_description":"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To","og_url":"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-11-25T03:59:34+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_creator":"@myxiechengxuan","twitter_misc":{"Written by":"windows-vps","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/","url":"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/","name":"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-11-25T03:59:34+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"description":"Which Defender folder and process exclusions an IIS and SQL Server host actually needs, which popular ones remove your last line of defence, and how to audit the list.","breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/windows-defender-exclusions-sql-iis-workloads\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"Windows Defender Exclusions for SQL Server and IIS: What to Add and What Not To"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog","https:\/\/x.com\/myxiechengxuan"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=1227"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1227\/revisions"}],"predecessor-version":[{"id":1230,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1227\/revisions\/1230"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=1227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=1227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=1227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}