Windows 2025
Sponsored Link

File Server : Set Network File Sharing2025/01/10

 

Set Network File and Folder Sharing.

On this example, Configure a sharing folder [E:\ShareAll] that everyone can read and write.

[1] Run PowerShell with Admin Privilege and Configure Sharing.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

# create a folder for sharing
PS C:\Users\Administrator> New-Item E:\ShareAll -ItemType Directory 

    Directory: E:\


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         1/10/2025   8:59 AM                ShareAll

# set sharing
# -Name [share name you like]
# -Path [path of shared folder]
# -FullAccess [users or groups that is granted full-control permission]
PS C:\Users\Administrator> New-SmbShare -Name "ShareAll" -Path "E:\ShareAll" -FullAccess "Everyone" 

Name     ScopeName Path        Description
----     --------- ----        -----------
ShareAll *         E:\ShareAll

# grant NTFS permission
PS C:\Users\Administrator> icacls "E:\ShareAll" /grant "Everyone:(OI)(CI)(F)" 
processed file: E:\ShareAll
Successfully processed 1 files; Failed processing 0 files

# confirm settings
PS C:\Users\Administrator> Get-SmbShare -Name "ShareAll" | Format-List -Property * 

PresetPathAcl          : System.Security.AccessControl.DirectorySecurity
ShareState             : Online
AvailabilityType       : NonClustered
ShareType              : FileSystemDirectory
FolderEnumerationMode  : Unrestricted
CachingMode            : Manual
LeasingMode            : Full
QoSFlowScope           : File
SmbInstance            : Default
CATimeout              : 0
CompressData           : False
ConcurrentUserLimit    : 0
ContinuouslyAvailable  : False
CurrentUsers           : 0
Description            :
DirectoryHandleLeasing : True
EncryptData            : False
IdentityRemoting       : False
Infrastructure         : False
IsolatedTransport      : False
Name                   : ShareAll
Path                   : E:\ShareAll
QoSPolicyId            : {00000000-0000-0000-0000-000000000000}
Scoped                 : False
ScopeName              : *
SecurityDescriptor     : O:SYG:SYD:(A;;FA;;;WD)
ShadowCopy             : False
Special                : False
Temporary              : False
Volume                 : \\?\Volume{b6ad6ff4-e470-4c88-9a44-6abd4922261c}\
PSComputerName         :
CimClass               : ROOT/Microsoft/Windows/SMB:MSFT_SmbShare
CimInstanceProperties  : {AvailabilityType, CachingMode, CATimeout, CompressData...}
CimSystemProperties    : Microsoft.Management.Infrastructure.CimSystemProperties
File Server : Set Network File Sharing (GUI)
 

On GUI configuration, set like follows.

[2] Right-Click the Folder you'd like to set Sharing and Open [Properties].
[3] Move to [Sharing] Tab and Click [Share...] button.
[4] Select users or groups you allow to access to Sharing. On this example, select [Everyone].
[5] Select Access permission for the users or groups you set. On this example, select [Read/Write].
[6] This is the setting of Network discovery and file sharing. Select the one for your requirements. On this example, select [No, *****].
[7] Sharing has been configured.
[8] To configure with [Share...] button, NTFS access permission is also configured automatically.
(on this example, Everyone:FullControl has been set)
Matched Content