Share a Folder from PowerShell with New-SmbShare
Create an SMB network share with explicit access rights using the SmbShare module — the scripted version of Explorer's Sharing tab.
01Command
$ New-SmbShare -Name 'Reports' -Path 'C:\Reports' -FullAccess 'Everyone' -ReadAccess 'Guest'02What it does
New-SmbShare does what the Sharing tab does but reproducibly: the share name is what other PCs type as \\YourPC\Reports, and the access parameters (-FullAccess, -ReadAccess, -ChangeAccess, -NoAccess) control who can do what. NTFS permissions still apply on top, so a user needs rights in both layers. This is the PowerShell 5.1+ way; the legacy equivalent is net share Reports=C:\Reports /GRANT:Everyone,FULL.
03Risk
04Undo
$ Remove-SmbShare -Name 'Reports' -Force05Sources
- New-SmbShareEvidence: New-SmbShare creates an SMB share with -Name, -Path and access lists such as -FullAccess and -ReadAccess.
- New-SmbShare - SS64Evidence: Documents share creation parameters and permission groups for the SmbShare module.
Last verified: 2026-09-18 · Category: Files & Folders
06Related solutions
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.
Search inside text files and logs with regex, returning file, line number and match.