PowerShell Logo Small

Close-SmbSession



This is the built-in help made by Microsoft for the command 'Close-SmbSession', 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

Forcibly ends the Server Message Block (SMB) session.

SYNTAX


Close-SmbSession [-AsJob] [-CimSession <CimSession[]>] [-Force] [-PassThru] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Close-SmbSession [[-SessionId] <UInt64[]>] [-AsJob] [-CimSession <CimSession[]>] [-ClientComputerName <String[]>] [-ClientUserName <String[]>] [-ClusterNodeName <String[]>]
[-Force] [-PassThru] [-ScopeName <String[]>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Close-SmbSession cmdlet forcibly ends the Server Message Block (SMB) session. Using this cmdlet may result in loss of data if the client for which session is being
stopped has not flushed all of the file modifications back to the server before the session is ended.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=289508
Get-SmbSession

REMARKS

<

Examples


EXAMPLE 1

PS C:\>Close-SmbSession -SessionId 8813272891621
Confirm
Are you sure you want to perform this action?
Performing operation 'Close-Session' on Target '8813272891621'.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): N



This example ends the SMB session.




EXAMPLE 2

PS C:\>Close-SmbSession -SessionId 8813272891621 -Force



This example ends the SMB session without user confirmation.