What files are open? Who is connected to the file server? Those informations might be useful for backing up, maintaining or restarting your file server. To accomplish this task run Get-SmbOpenFile to show the path of the share, the open files and the connected user.
Open Windows PowerShell an run
Get-SmbOpenFile | Format-List
To show only connections for a specific file share run Get-SmbOpenFile with Where-Object.
Get-SmbOpenFile | Where-Object Path -eq "C:\Data\" | Format-List
To show all connections run
Closing open files
My next task is to close those open files. First, I look for the FileId.
For this file, it’s all over now 😉
Close-SmbOpenFile -FileId 120259084297