Forum Discussion
JohnnyHuang
Jun 04, 2021Copper Contributor
How to Share sub Folders with Specific Users in Windows
Current i got some specific user need to access many of sub folder, any idea or easy way to perform ?
Andy Meboldt
Jun 18, 2021Copper Contributor
What is your goal?
Do you want to know how to share the root-folder or how to share all subfolders?
To create a share for each subfolder, you can use the following Powershell:
$Roofolder = "D:\Folder"
$User = "domain\username"
$Subfolders = Get-ChildItem -Path $Roofolder
foreach($Subfolder in $Subfolders){New-SmbShare -Name $Subfolder.Name -Path $Subfolder.fullname -FullAccess $User}