PowerShell Logo Small

Remove-SmbShare



This is the built-in help made by Microsoft for the command 'Remove-SmbShare', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Deletes the specified Server Message Block (SMB) shares.

SYNTAX


Remove-SmbShare [-Name] <String[]> [[-ScopeName] <String[]>] [-AsJob] [-CimSession <CimSession[]>] [-Force] [-PassThru] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf]
[<CommonParameters>]
Remove-SmbShare [-AsJob] [-CimSession <CimSession[]>] [-Force] [-PassThru] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-SMBShare cmdlet deletes one or more Server Message Block (SMB) shares.


Removing an SMB share forcibly disconnects all of the existing connections to the share. Use this cmdlet with caution. Clients that are forcibly disconnected from a share
will not have an opportunity to flush locally cached data before being disconnected, which may result in data loss. The Get-SmbSession cmdlet may be used to determine if
users are connected to a share.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=289687
Get-SmbShare
New-SmbShare
Set-SmbShare

REMARKS

<

Examples


EXAMPLE 1

PS C:\>Remove-SmbShare –Name Data
Confirm
Are you sure you want to perform this action?
Performing operation 'Remove-Share' on Target 'Contoso-FS,Data'.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):



This example deletes the SMB share named Data.




EXAMPLE 2

PS C:\>Remove-SmbShare -Name VMFiles -ScopeName Contoso-SO -Force



This example deletes the SMB share named VMFiles without user confirmation.