Validate Windows Server file share permissions across SMB and NTFS
When setting up shared team documents, the problem is often not a missing shared folder. More commonly, users can open the folder but cannot save files, or an account intended for read-only access can unexpectedly delete them. Troubleshooting must cover SMB share permissions, NTFS file permissions, and the identity the client is actually using. Testing locally as an administrator is no substitute for acceptance testing with ordinary user accounts.
This walkthrough assumes Windows Server 2022, a new empty folder on NTFS, and a standalone server. Run the commands in 64-bit Windows PowerShell with administrator privileges. On a domain-joined server, use domain security groups rather than copying the local-group approach unchanged. AmdSrv Windows servers are managed through RDP, with connection credentials available in the console after payment. The configuration below is an operating-system administration procedure.
1. Define access boundaries and preserve a recovery path
Create two access groups: a read-only group that can list folders and read files, and a modify group that can create, edit, and delete files. For network access, both share permissions and NTFS permissions must allow the operation. Group membership and explicit deny entries also affect the effective permissions.
Modify includes deletion; it does not mean “upload only.” Do not store backups in a shared folder that ordinary members can modify. Permission isolation is not a substitute for an independent backup.
Run this experiment only in a newly created empty folder. Do not recursively overwrite permissions on an existing production directory tree. First verify the volume’s file system, available space, and the folder’s purpose, then keep an administrator RDP session open. SMB should not be exposed directly to the public internet; access it through a controlled private network or an authorized encrypted access path. This article does not change firewall settings or expand the existing scope of network access.
$Path = 'C:\SrvData\TeamDocs'
$Share = 'TeamDocs'
if (Test-Path $Path) { throw 'Target directory already exists' }
New-Item -ItemType Directory -Path $Path -Force | Out-Null
$Before = Join-Path $env:ProgramData 'TeamDocs-before.sddl'
(Get-Acl -LiteralPath $Path).Sddl |
Set-Content -LiteralPath $Before -Encoding ASCII
This path is only a choice for the experiment, not a representation of the disk layout provided with the server. For an existing folder, first export its ACLs in full and back up the data. Do not empty a folder just to apply this example.
2. Build an NTFS allowlist with security groups
First create two dedicated local groups. Grant business users access through group membership rather than adding each account to the ACL individually. The following group names must not already exist. If either name is already in use, stop and check what the existing group is used for.
New-LocalGroup -Name 'DocsReaders' | Out-Null
New-LocalGroup -Name 'DocsWriters' | Out-Null
$Readers = Get-LocalGroup -Name 'DocsReaders'
$Writers = Get-LocalGroup -Name 'DocsWriters'
$SystemSid = [System.Security.Principal.SecurityIdentifier]::new(
'S-1-5-18'
)
$AdminSid = [System.Security.Principal.SecurityIdentifier]::new(
'S-1-5-32-544'
)
$Acl = Get-Acl -LiteralPath $Path
$Acl.SetAccessRuleProtection($true, $false)
foreach ($Rule in @($Acl.Access)) {
[void]$Acl.RemoveAccessRuleSpecific($Rule)
}
$Entries = @(
@($SystemSid, 'FullControl'),
@($AdminSid, 'FullControl'),
@($Readers.SID, 'ReadAndExecute'),
@($Writers.SID, 'Modify')
)
foreach ($Entry in $Entries) {
$Rule = [System.Security.AccessControl.FileSystemAccessRule]::new(
$Entry[0], $Entry[1],
'ContainerInherit,ObjectInherit', 'None', 'Allow'
)
[void]$Acl.AddAccessRule($Rule)
}
Set-Acl -LiteralPath $Path -AclObject $Acl
(Get-Acl -LiteralPath $Path).Access |
Format-Table IdentityReference, FileSystemRights, IsInherited
This disables inheritance and removes existing access rules to establish an explicit allowlist for the empty test folder only. Identifying the system account and administrators group by SID avoids differences in group names across system languages. Other SIDs still need to be checked to confirm what they identify.
New subfolders and files will inherit these rules, but files moved into the folder may retain different ACLs. In particular, do not assume that a move within the same volume rebuilds permissions. After importing business data, check a sample of actual files, not just the share’s root folder.
3. Create the share and assign business accounts
At the share level, grant Read and Change permissions separately, while retaining Full Control for administrators. Convert the SIDs to account names recognized by the current system before creating the share, rather than hard-coding localized group names.
$ReaderName = $Readers.SID.Translate(
[System.Security.Principal.NTAccount]
).Value
$WriterName = $Writers.SID.Translate(
[System.Security.Principal.NTAccount]
).Value
$AdminName = $AdminSid.Translate(
[System.Security.Principal.NTAccount]
).Value
New-SmbShare -Name $Share -Path $Path `
-ReadAccess $ReaderName -ChangeAccess $WriterName `
-FullAccess $AdminName | Out-Null
Get-SmbShareAccess -Name $Share
Set-Content -LiteralPath (Join-Path $Path 'read-check.txt') `
-Value 'permission-check'
Use two existing ordinary test accounts and add each to its respective group. Member names are entered interactively; this example does not create accounts or specify passwords or login names.
$ReadUser = Read-Host 'Existing read-only test account'
$WriteUser = Read-Host 'Existing modify test account'
Add-LocalGroupMember -Group 'DocsReaders' -Member $ReadUser
Add-LocalGroupMember -Group 'DocsWriters' -Member $WriteUser
Get-LocalGroupMember -Group 'DocsReaders'
Get-LocalGroupMember -Group 'DocsWriters'
After changing group membership, sign in again with the test accounts and establish new connections. Old logon tokens and SMB sessions may retain the previous identity information. Repeated ACL changes generally do not resolve this kind of caching issue.
4. Validate reading, writing, and deletion from a separate client
Test each ordinary account in its own client logon session. Do not use an administrator account or a local path on the server. Use the actual controlled address in the share path, and avoid testing from a client that already has a connection to the same server with different credentials.
$Root = Read-Host 'UNC path of the test share'
Get-Content -LiteralPath (Join-Path $Root 'read-check.txt')
$Probe = Join-Path $Root ('probe-' + [guid]::NewGuid() + '.txt')
New-Item -ItemType File -Path $Probe -ErrorAction Stop
Set-Content -LiteralPath $Probe -Value 'write-check' -ErrorAction Stop
Remove-Item -LiteralPath $Probe -ErrorAction Stop
Get-SmbConnection |
Select-Object ServerName, ShareName, UserName, Dialect
The read-only account should succeed at reading and fail at creating a file. After that failure, do not treat the remaining steps as valid acceptance results. The modify account should successfully create, write, and delete the file, then reconnect and read the baseline file again.
Also have the modify account create a dedicated test file for deletion, then attempt to delete it with the read-only account. The expected result is access denied. Test another ordinary account that belongs to neither business group; it should be unable to access the share. Perform all deletion tests only on dedicated test files.
Business applications may save by writing a temporary file and then renaming it to replace the original. A successful basic write test is therefore not enough. Before putting the share into production, use the actual editor to test opening, saving, saving as, and overwriting files, and confirm that no temporary files are left behind.
5. Retain evidence and verify permission rollback
Acceptance records should include, at minimum, the share ACL, ACLs for the root folder and sampled files, group membership, the client’s actual identity, and the result of each operation. Do not save passwords or copy business document contents into troubleshooting records.
When permissions behave unexpectedly, check the identity, share layer, NTFS layer, and file inheritance in that order. A visible folder does not guarantee readable files, and a correct root-folder ACL does not mean every file beneath it has consistent permissions.
To undo this empty-folder experiment, first stop client writes, then remove the share and restore the original security descriptor:
Remove-SmbShare -Name $Share -Force
$Restore = Get-Acl -LiteralPath $Path
$Restore.SetSecurityDescriptorSddlForm(
(Get-Content -LiteralPath $Before -Raw).Trim()
)
Set-Acl -LiteralPath $Path -AclObject $Restore
This restores only the experiment’s root folder. It does not restore data or the separate permissions of files created later. A production directory tree requires a backup strategy that covers every object. Remove the members and test groups only after confirming that no other resources reference those groups.
The final handover criterion is not “the share has been created.” Authorized accounts must be able to complete the agreed operations, unauthorized operations must actually be denied, and every permission change must have a verifiable record and a recovery path.
Frequently asked questions
Why can a user not write when the share allows changes?
An operation over SMB must be allowed by both share permissions and NTFS permissions. Check group membership, explicit deny entries, and inheritance on the actual file.
Does NTFS Modify permission include deletion?
Yes. The modify group in this example can create, edit, and delete files. Allowing writes without deletion requires a separate advanced ACL design and tests for temporary-file saves and renames.
AmdSrv Dedicated Server with AMD EPYC 7543P, from $458/month