{"id":1228,"date":"2026-11-25T03:23:09","date_gmt":"2026-11-25T03:23:09","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=1228"},"modified":"2026-11-25T03:23:09","modified_gmt":"2026-11-25T03:23:09","slug":"ntfs-permissions-inheritance-iis-app-pools","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/","title":{"rendered":"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap"},"content":{"rendered":"<div style=\"padding:20px\">\n<p>The share-permission article on this site covers SMB file servers. This one is about the narrower and far more common failure: an IIS application that throws HTTP 500.19 on a configuration file, or a 401.3 on a static asset, because the app pool identity never had the ACL in the first place \u2014 or had it and lost it when someone copied the folder.<\/p>\n<h2>What the app pool identity actually is<\/h2>\n<p>In IIS 7 and later, an app pool runs as <code>ApplicationPoolIdentity<\/code> by default, which resolves to a virtual account named <code>IIS AppPool\\<\/code>. That account is a real security principal: it is a member of <code>IIS_IUSRS<\/code> automatically, and it can hold NTFS permissions directly even though it has no local user profile on disk. The display name in <code>icacls<\/code> output is <code>IIS APPPOOL\\MySite<\/code>, and permissions on a <a href=\"https:\/\/windows-vps.org\/\">Windows VPS<\/a> are fully under your control.<\/p>\n<p>Confirm what a site is really running as before touching any ACL. <code>appcmd list apppool \/name:MySite \/text:processModel.identityType<\/code> returns the configured identity, and <code>Get-Process w3wp | Select Id, StartTime<\/code> paired with the worker process mapping in <code>appcmd list wp<\/code> shows which pool owns which PID. A pool set to <code>NetworkService<\/code> or a custom user needs completely different ACLs than the default virtual account.<\/p>\n<h2>Read the 500.19 before you guess at permissions<\/h2>\n<p>HTTP 500.19 with error code <code>0x80070005<\/code> means access denied, and the message text names the configuration file it could not read \u2014 usually <code>web.config<\/code>. That is an ACL problem on the file, not a web.config syntax problem. The same status code with <code>0x8007000d<\/code> is malformed XML, and <code>0x800700b7<\/code> is a duplicate section definition; those need a config fix, not a permission change.<\/p>\n<p>Look at the detail line rather than the code. IIS reports <code>Config File<\/code>, <code>Config Source<\/code> and the requesting identity. If the identity shown is the pool account and the file is one you can open in Notepad as administrator, the ACL is missing that specific principal. Enable failed request tracing if the message is truncated: <code>%SystemDrive%\\inetpub\\logs\\FailedReqLogFiles<\/code> holds the full trace once the rule is on for the site.<\/p>\n<h2>Inheritance is usually the real culprit<\/h2>\n<p>Copying a published folder with <code>robocopy<\/code> without <code>\/COPYALL<\/code> preserves files but drops ACLs. Extracting a zip created on another machine brings whatever DACL the archive tool stamped onto the parent. Moving a folder between volumes on Windows preserves permissions only for same-volume moves; a cross-volume move becomes a copy and inherits the destination. Any of these leaves a site that worked on the build server failing on the target.<\/p>\n<p>Check inheritance on the site root with <code>icacls C:\\inetpub\\MySite<\/code>. Output lines ending in <code>(I)<\/code> are inherited; lines without it are explicit and survive parent changes. If the root has an explicit deny or a broken inheritance flag, the fix is at the root, not on the individual file. Explicit ACEs on subfolders that were copied along are the usual reason a permission fix on the root does not take effect.<\/p>\n<h2>Build the ACL deliberately, not by hand<\/h2>\n<p>Grant the pool identity read and execute on the application directory, and write only where the app writes. <code>icacls C:\\inetpub\\MySite \/grant \"IIS APPPOOL\\MySite:(OI)(CI)RX\" \/T<\/code> applies inherited read to the tree. Then grant modify on a single directory: <code>icacls C:\\inetpub\\MySite\\App_Data \/grant \"IIS APPPOOL\\MySite:(OI)(CI)M\"<\/code>. Do not grant Full Control on the site root \u2014 a compromise in the app then rewrites its own compiled assemblies.<\/p>\n<p>The uploads and cache directories deserve the modify grant; <code>bin<\/code>, <code>web.config<\/code> and the compiled views do not. <code>(OI)(CI)<\/code> makes the entry inherit to files and folders created later, which is what makes the grant survive the next deployment. Skip that flag and the next build drops new files the pool cannot read.<\/p>\n<h2>Fix the inheritance flag itself<\/h2>\n<p>When a folder shows <code>Access is denied<\/code> for administrators or the copied ACEs are stubborn, reset inheritance explicitly. <code>icacls C:\\inetpub\\MySite \/inheritance:e<\/code> re-enables inheritance from the parent, and <code>\/reset \/T<\/code> replaces the whole tree&#8217;s ACLs with what the parent supplies. Run <code>\/inheritance:r<\/code> only when you intend to remove inherited entries and keep explicit ones \u2014 that is a destructive operation on a web root and should be preceded by <code>icacls C:\\inetpub\\MySite \/save acl_backup.txt \/T<\/code>.<\/p>\n<p>On a correctly built host the <code>C:\\inetpub<\/code> root grants <code>IIS_IUSRS<\/code> read and execute with inheritance on, and every site gets its extra grants beneath it. If someone has set deny ACEs anywhere in that chain, the pool account inherits the deny and no amount of granting below it will help \u2014 deny always beats allow in the Windows access check.<\/p>\n<h2>Verify effective access instead of assuming<\/h2>\n<p>After changing an ACL, prove it with the tool that evaluates the real access check. <code>icacls C:\\inetpub\\MySite\\web.config<\/code> prints granted and denied entries for that file, and PowerShell&#8217;s <code>Get-Acl<\/code> gives the object model. For the definitive test, use the Effective Access tab in the file&#8217;s Advanced Security dialog against <code>IIS APPPOOL\\MySite<\/code>, or reuse the pool account in a schtasks run if you need a scriptable check.<\/p>\n<p>Recycle the pool after ACL changes: <code>appcmd recycle apppool \/apppool.name:MySite<\/code>. The worker process caches access tokens and file handles, so a running pool can keep failing on a file that is now readable. Confirm the fresh request succeeds before declaring the fix complete, and check the IIS log for the new status code rather than relying on a browser refresh.<\/p>\n<h2>Make it survive the next deployment<\/h2>\n<p>Every deployment pipeline needs a step that reapplies ACLs, not just one that copies files. A one-line <code>icacls<\/code> call in the post-publish script is enough, and it removes the entire class of &#8220;worked on staging, 500.19 in production&#8221; incidents. Include the pool name as a variable so the script works for any site on the box.<\/p>\n<p>If you are still deciding where to run this, pick a host that gives you full administrative control over the file system and the IIS metabase \u2014 the article on <a href=\"https:\/\/windows-vps.org\/\">Windows VPS<\/a> hosting covers what that means in practice. And before the next deployment, write the current ACL state to a file so you have something to compare against when the app suddenly cannot read its own config.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Why IIS app pools lose file access after a copy or deploy, how to read 500.19 error codes, and the icacls commands that make grants survive the next release.<\/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-1228","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>NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap - Windows VPS Blog<\/title>\n<meta name=\"description\" content=\"Why IIS app pools lose file access after a copy or deploy, how to read 500.19 error codes, and the icacls commands that make grants survive the next release.\" \/>\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\/ntfs-permissions-inheritance-iis-app-pools\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap\" \/>\n<meta property=\"og:description\" content=\"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-25T03:23:09+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\/ntfs-permissions-inheritance-iis-app-pools\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/\",\"name\":\"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-11-25T03:23:09+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"description\":\"Why IIS app pools lose file access after a copy or deploy, how to read 500.19 error codes, and the icacls commands that make grants survive the next release.\",\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap\"}]},{\"@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":"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap - Windows VPS Blog","description":"Why IIS app pools lose file access after a copy or deploy, how to read 500.19 error codes, and the icacls commands that make grants survive the next release.","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\/ntfs-permissions-inheritance-iis-app-pools\/","og_locale":"en_US","og_type":"article","og_title":"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap","og_description":"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap","og_url":"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-11-25T03:23:09+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\/ntfs-permissions-inheritance-iis-app-pools\/","url":"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/","name":"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-11-25T03:23:09+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"description":"Why IIS app pools lose file access after a copy or deploy, how to read 500.19 error codes, and the icacls commands that make grants survive the next release.","breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/ntfs-permissions-inheritance-iis-app-pools\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"NTFS Permissions for IIS App Pools: Inheritance, Identity, and the 500.19 Trap"}]},{"@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\/1228","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=1228"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1228\/revisions"}],"predecessor-version":[{"id":1229,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1228\/revisions\/1229"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=1228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=1228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=1228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}