{"id":64,"date":"2025-11-16T02:58:33","date_gmt":"2025-11-16T02:58:33","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=64"},"modified":"2026-10-30T22:10:35","modified_gmt":"2026-10-30T22:10:35","slug":"smb-file-shares-windows-vps-permissions-automation","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/","title":{"rendered":"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">SMB looks simple until the second user appears. A share that works perfectly for the local administrator fails for a service account because of one inherited ACE, and the symptom is never &#8220;access denied&#8221; in a useful place \u2014 it is an application log line saying the file is in use, or a backup job that silently writes zero bytes. On a Windows VPS where the share is the actual storage layer for IIS content or a scheduled export, permissions are the difference between a working service and a 3 a.m. call.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This covers how NTFS and share permissions combine, where inheritance breaks, how to audit effective access without guessing, and how to automate share provisioning with PowerShell so the same ACE set lands on every VPS you build. All examples assume a Windows Server 2019\/2022 VPS with a single data volume, which is how most hosting images are laid out \u2014 the storage and OS options are summarised at <a href=\"https:\/\/windows-vps.org\/\">our Windows VPS comparison<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Share permissions are a ceiling, not a grant<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Windows evaluates share permission and NTFS permission separately and applies the more restrictive of the two. A user with Full Control on the share and Modify on NTFS gets Modify. A user with Read on the share and Full Control on NTFS gets Read. The trap is that share permissions default to Everyone:Read on a new share, so teams spend an hour editing ACLs before realising the ceiling was never raised.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the share ceiling to <code>Everyone:Change<\/code> and do all real authorisation in NTFS, where you have inheritance, auditing, and <code>icacls<\/code> support. Never create per-user share permissions \u2014 they do not survive a share recreation and are invisible in Explorer&#8217;s Security tab. Check the ceiling with <code>Get-SmbShareAccess -Name data<\/code> and confirm it looks identical on every host you build.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where inheritance silently breaks<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An ACE marked &#8220;This folder only&#8221; stops propagating the moment someone copies a directory tree with <code>robocopy<\/code> without <code>\/SEC<\/code>, or restores files from a backup catalog. The child objects keep explicit ACEs copied from the source and no longer inherit. Result: new files land in a folder whose inherited policy no longer reaches subfolders, and permissions drift only on that branch.<\/p>\n\n\n<p class=\"wp-block-paragraph\">Audit for it with a one-liner that lists directories where inheritance is disabled: <code>Get-ChildItem D:\\data -Directory -Recurse | Where-Object { (Get-Acl $_.FullName).AreAccessRulesProtected } | Select-Object FullName<\/code>. Re-enable inheritance deliberately, not in bulk, because enabling it on a folder that relied on explicit denies will broaden access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A permission model that survives rebuilds<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use three groups per share and nothing else: <code>SG_Data_Read<\/code>, <code>SG_Data_Modify<\/code>, and <code>SG_Data_Admin<\/code>. Assign users to groups, never to folders. Grant the groups at the share root with inheritance enabled, and add a single explicit deny only where a genuine exception exists \u2014 a quarantine folder that no one but the admin group can read.<\/p>\n\n\n<p class=\"wp-block-paragraph\">This model means a rebuild is three <code>icacls<\/code> calls and two <code>Add-LocalGroupMember<\/code> calls. It also means access reviews are group membership exports, which any auditor will accept, rather than an ACL diff that no one can read. Keep the group names stable across hosts so a script written once applies everywhere.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Recommended ACL matrix<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Path<\/th><th>Principal<\/th><th>NTFS rights<\/th><th>Applies to<\/th><\/tr><\/thead><tbody><tr><td>D:\\data<\/td><td>SG_Data_Read<\/td><td>Read &amp; Execute<\/td><td>This folder, subfolders, files<\/td><\/tr><tr><td>D:\\data<\/td><td>SG_Data_Modify<\/td><td>Modify<\/td><td>This folder, subfolders, files<\/td><\/tr><tr><td>D:\\data<\/td><td>SG_Data_Admin<\/td><td>Full Control<\/td><td>This folder, subfolders, files<\/td><\/tr><tr><td>D:\\data\\quarantine<\/td><td>SG_Data_Read<\/td><td>Deny: List folder<\/td><td>This folder only<\/td><\/tr><tr><td>D:\\data\\quarantine<\/td><td>SG_Data_Admin<\/td><td>Full Control<\/td><td>This folder, subfolders, files<\/td><\/tr><tr><td>D:\\data\\drop<\/td><td>SG_Data_Modify<\/td><td>Write, Create files<\/td><td>This folder only<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Where the model breaks on a workgroup VPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most single-server plans are not domain-joined, so local groups are the only option and they do not survive an image rebuild. Export them to CSV as a build artefact: <code>Get-LocalGroupMember SG_Data_Modify | Export-Csv members.csv<\/code>. Restoring a rebuilt host becomes one import loop, and the ACLs come back from the same script that created them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Access-based enumeration adds a second trap. With ABE enabled, folders a user cannot read simply do not appear in the share, so a user reports a missing folder when in reality they lack List on a parent. Set it per share with <code>Set-SmbShare -Name data -FolderEnumerationMode AccessBased<\/code> \u2014 off by default on Server 2019\/2022 \u2014 and leave it off for application shares, where a service expecting a predictable listing fails in a way that looks like a timeout.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Automating share creation with PowerShell<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following has to be idempotent \u2014 it must be safe to run twice on the same host. <code>New-SmbShare<\/code> fails if the share exists, so test first, and use <code>icacls<\/code> with <code>\/grant<\/code> rather than rebuilding the whole DACL, which would drop explicit denies you set on purpose.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$path = 'D:\\data'\n$name = 'data'\nif (-not (Get-SmbShare -Name $name -ErrorAction SilentlyContinue)) {\n  New-SmbShare -Name $name -Path $path -ChangeAccess 'Everyone' -FullAccess 'Administrators'\n}\nforeach ($g in 'SG_Data_Read','SG_Data_Modify','SG_Data_Admin') {\n  if (-not (Get-LocalGroup -Name $g -ErrorAction SilentlyContinue)) { New-LocalGroup -Name $g }\n}\nicacls $path \/grant 'SG_Data_Read:(OI)(CI)RX' 'SG_Data_Modify:(OI)(CI)M' 'SG_Data_Admin:(OI)(CI)F' \/T \/Q\nicacls $path \/inheritance:e<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Verifying effective access before users complain<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>icacls<\/code> shows ACEs but not the result. Use <code>Get-Acl<\/code> plus a group expansion to compute effective access for a named user, or rely on the SMB client itself: <code>net use Z: \\\\localhost\\data \/user:DOMAIN\\svc_web<\/code> from the server, then attempt a write. A successful write from a session running as the service account is the only proof that matters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For scheduled jobs, verify with the actual task principal rather than your own account \u2014 a task running as SYSTEM bypasses most denies and will pass a test that your application fails. Log the verification result in the build script so a rebuild that breaks permissions fails loudly instead of at the first customer upload. Provider-side disk layout and snapshot behaviour also affect whether ACLs survive a restore, which is worth confirming on <a href=\"https:\/\/windows-vps.org\/#providers\">the plan comparison table<\/a> before you commit a data volume to a single host.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>SMB looks simple until the second user appears. A share that works perfectly for the local administrator fails for a service account because of one inherited ACE, and the symptom is never &#8220;access denied&#8221; in a useful place \u2014 it is an application log line saying the file is in use, or a backup job &#8230; <a title=\"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation\" class=\"read-more\" href=\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/\" aria-label=\"Read more about SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":65,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials-guides"],"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>SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation - Windows VPS Blog<\/title>\n<meta name=\"description\" content=\"Connecting to a Linux Virtual Private Server (VPS) from a Windows machine is an essential skill for developers, system administrators, and tech enthusiasts. This guide will walk you through the process, ensuring you can manage your Linux VPS effectively.\" \/>\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\/smb-file-shares-windows-vps-permissions-automation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation\" \/>\n<meta property=\"og:description\" content=\"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-16T02:58:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-30T22:10:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"853\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/\",\"name\":\"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg\",\"datePublished\":\"2025-11-16T02:58:33+00:00\",\"dateModified\":\"2026-10-30T22:10:35+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"description\":\"Connecting to a Linux Virtual Private Server (VPS) from a Windows machine is an essential skill for developers, system administrators, and tech enthusiasts. This guide will walk you through the process, ensuring you can manage your Linux VPS effectively.\",\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#primaryimage\",\"url\":\"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg\",\"contentUrl\":\"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg\",\"width\":1280,\"height\":853},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation\"}]},{\"@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":"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation - Windows VPS Blog","description":"Connecting to a Linux Virtual Private Server (VPS) from a Windows machine is an essential skill for developers, system administrators, and tech enthusiasts. This guide will walk you through the process, ensuring you can manage your Linux VPS effectively.","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\/smb-file-shares-windows-vps-permissions-automation\/","og_locale":"en_US","og_type":"article","og_title":"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation","og_description":"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation","og_url":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/","og_site_name":"Windows VPS Blog","article_published_time":"2025-11-16T02:58:33+00:00","article_modified_time":"2026-10-30T22:10:35+00:00","og_image":[{"width":1280,"height":853,"url":"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg","type":"image\/jpeg"}],"author":"windows-vps","twitter_card":"summary_large_image","twitter_creator":"@myxiechengxuan","twitter_misc":{"Written by":"windows-vps","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/","url":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/","name":"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#primaryimage"},"image":{"@id":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#primaryimage"},"thumbnailUrl":"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg","datePublished":"2025-11-16T02:58:33+00:00","dateModified":"2026-10-30T22:10:35+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"description":"Connecting to a Linux Virtual Private Server (VPS) from a Windows machine is an essential skill for developers, system administrators, and tech enthusiasts. This guide will walk you through the process, ensuring you can manage your Linux VPS effectively.","breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#primaryimage","url":"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg","contentUrl":"https:\/\/windows-vps.org\/blog\/wp-content\/uploads\/2025\/11\/11584.jpg","width":1280,"height":853},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/smb-file-shares-windows-vps-permissions-automation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"SMB File Shares on a Windows VPS: Permissions, Access Control, and Automation"}]},{"@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\/64","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=64"}],"version-history":[{"count":3,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":974,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/64\/revisions\/974"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media\/65"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}