In my last article on the Nano Server 2016 File Server SMB File Share topic I’ll show you how I view and close open sessions \ Files of users connected to my SMB Share.
Articles previously published on this series:
- Create An SMB File Share On a Windows Nano Server 2016
- Create A Local User Account On Windows Nano Server 2016 Using PowerShell
- Add \ Remove Permissions From SMB File Share On Nano Server 20106 Using PowerShell
- Deploy File Server On a Window Nano Server 2016 TP5
If you haven’t setup your Nano Server use my article on how to Install And Run Nano Server Technical Preview 5.
Once your Nano Server Is Configured Connect to It using PowerShell Direct, Connect To A Nano Server Using PowerShell Direct or using PowerShell Remoting How To Connect To A Windows Nano Server Using PowerShell.
To view all open session on my Nano File Server I type:
Get-SmbSession |select sessionid, ClientUsername, NumOpens
To view open files I use:
Get-SmbOpenFile | select fileid, sessionid,path, clientusername
To close specific session I type:
Close-SmbSession -SessionId 549755813905 -Confirm:$false -Verbose -PassThru
To close open file I use:
Close-SmbOpenFile -SessionId 549755813909 -Confirm:$false -Verbose -PassThru