Stop Sharing a Folder with Remove-SmbShare
List all SMB shares with Get-SmbShare, then delete an unwanted share with Remove-SmbShare -Force.
01Command
$ Get-SmbShare | Format-Table Name, Path -AutoSize
Remove-SmbShare -Name 'Reports' -Force02What it does
Removing the share only un-publishes the folder on the network — the files and their NTFS permissions stay untouched, and hidden system shares such as ADMIN$ and C$ are managed by Windows and shouldn't be removed. Because the access list is destroyed with the share, note it before deleting in case you re-share later. A quick Get-SmbShare audit is also useful after buying a second-hand PC or a malware scare.
03Risk
04Undo
$ Re-create it with New-SmbShare (the access list is deleted with the share, so note it beforehand).05Sources
- Remove-SmbShareEvidence: Remove-SmbShare deletes an SMB share by name; -Force suppresses the confirmation prompt.
- SmbShare module - SS64Evidence: Lists Get-SmbShare for auditing shares and Remove-SmbShare for deleting them.
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.