![]() |
| Learn how to check open SMB files in Windows 11 using PowerShell, identify connected users and computers, and troubleshoot locked network files. |
If multiple computers access a shared folder on a Windows 11 PC, you may sometimes need to know which files are currently open over the network. This can be especially useful when a file cannot be renamed, moved, deleted, or modified because another user or computer is still accessing it.
Windows provides PowerShell commands that can help administrators inspect SMB activity. One of the most useful commands is Get-SmbOpenFile, which retrieves information about files that are open on behalf of SMB clients.
In this guide, you will learn how to check open SMB files in Windows 11, identify the connected client and user, filter results, understand the information returned by PowerShell, and troubleshoot files that remain locked by network users.
What Is an Open SMB File?
SMB, or Server Message Block, is the Windows networking protocol commonly used for accessing shared files and folders over a local network.
When another computer opens a file from a shared folder on your Windows 11 PC, the SMB server maintains information about that file access. The file can therefore appear as an open SMB file while the remote client is using it.
For example, imagine that a folder named Projects is shared from a Windows 11 computer. Another PC opens:
\\FILESERVER\Projects\report.xlsx
While the remote user has the Excel file open, Windows can maintain an SMB file-open record associated with that client session.
This information can help you determine:
- Which file is currently open.
- Which computer opened the file.
- Which user is accessing the file.
- Which SMB session is associated with the file.
- Whether a network file is still being used before performing maintenance.
Why Check Open SMB Files in Windows 11?
Checking open SMB files can be useful when troubleshooting network file sharing or managing a Windows computer that acts as a file server.
Common situations include:
- A shared file cannot be deleted.
- A folder cannot be renamed because a remote user is using a file inside it.
- You need to identify who is currently using a shared document.
- A user reports that a file is locked.
- You need to investigate active network file access.
- You want to correlate an open file with an SMB session.
- You are preparing to perform maintenance on a shared folder.
Before investigating open files, it can also help to understand active SMB sessions and client connections. See our guides on checking SMB sessions in Windows 11 and checking SMB connections in Windows 11.
How to Check Open SMB Files Using PowerShell
The primary PowerShell command for viewing open SMB files is:
Get-SmbOpenFile
Open Windows Terminal or PowerShell with administrator privileges and run the command.
The command retrieves basic information about files that are open on behalf of SMB clients on the SMB server.
If there are active network file accesses, PowerShell can return information about the open files. If there are no matching open files, the result may be empty.
Step 1: Open PowerShell as Administrator
Start by opening an elevated PowerShell session.
- Open the Start menu.
- Search for PowerShell or Windows Terminal.
- Right-click the application.
- Select Run as administrator.
- Approve the User Account Control prompt if requested.
Running PowerShell with appropriate administrative permissions is recommended when inspecting SMB server activity and related network resources.
Step 2: Run Get-SmbOpenFile
Enter the following command:
Get-SmbOpenFile
This is the simplest way to retrieve the current open SMB file information.
The exact output can vary depending on the Windows version, SMB activity, permissions, and available SMB sessions.
Step 3: Display the Most Useful Properties
The default output may contain more information than you need. You can use Select-Object to display selected properties.
Get-SmbOpenFile | Select-Object ClientComputerName, ClientUserName, SessionId, Path
This makes the output easier to read when your primary goal is to identify the remote computer, user, session, and file path.
For example, the information can conceptually look like this:
ClientComputerName ClientUserName SessionId Path
------------------ -------------- --------- ----
PC-CLIENT01 USER1 123456 D:\Shares\Projects\report.xlsx
PC-CLIENT02 USER2 123457 D:\Shares\Documents\budget.xlsx
The actual values on your computer will be different.
Understanding Get-SmbOpenFile Output
Several properties can help you understand where an open SMB file is being accessed from.
ClientComputerName
ClientComputerName identifies the client computer associated with the open file.
This is useful when multiple computers access the same shared folder and you need to determine which device is currently using a file.
ClientUserName
ClientUserName identifies the user associated with the SMB client connection.
This can help when several users access the same shared folder and one file appears to be locked.
SessionId
SessionId identifies the SMB session associated with the open file.
You can use this information together with Get-SmbSession to investigate the corresponding SMB session.
Get-SmbSession
This is particularly useful when you need to move from a specific open file to the broader network session responsible for it.
Path
The Path property can identify the local path of the file being accessed through SMB.
This is useful when several shared folders exist on the same computer and you need to determine exactly which file is being accessed.
How to Find Open Files from a Specific Computer
If you know the client computer that may be using a file, you can filter the results by client computer name.
Get-SmbOpenFile -ClientComputerName "PC-CLIENT01"
Replace PC-CLIENT01 with the actual client computer name.
You can also select only the most useful properties:
Get-SmbOpenFile -ClientComputerName "PC-CLIENT01" |
Select-Object ClientComputerName, ClientUserName, SessionId, Path
This is useful when troubleshooting a specific workstation that is suspected of keeping a network file open.
How to Find Open Files for a Specific User
You can also filter open SMB files by the client user name.
Get-SmbOpenFile -ClientUserName "DOMAIN\User1"
Replace the example account with the appropriate username in your environment.
To make the result easier to read:
Get-SmbOpenFile -ClientUserName "DOMAIN\User1" |
Select-Object ClientComputerName, ClientUserName, SessionId, Path
This can be useful in environments where several users access the same network share.
How to Find an Open File by File ID
When you already know the SMB file ID, you can use the -FileId parameter.
Get-SmbOpenFile -FileId 123456789
Replace the example number with the actual file ID returned by your SMB configuration.
This method is more useful during detailed troubleshooting when you have already identified a specific SMB file record.
How to Find Open Files by Session ID
If you have identified an SMB session ID, you can use it to find the files associated with that session.
Get-SmbOpenFile -SessionId 123456
This creates a useful relationship between SMB sessions and open files.
A practical troubleshooting sequence is:
- Run
Get-SmbSessionto identify active sessions. - Identify the relevant
SessionId. - Run
Get-SmbOpenFile -SessionIdusing that session ID. - Review the files associated with the session.
How to List Open SMB Files with More Details
If you want to inspect all available properties returned by the cmdlet, you can pipe the results to Format-List.
Get-SmbOpenFile | Format-List *
This can produce a much larger output than the default table view, but it can be useful when troubleshooting an unusual SMB file-access problem.
For regular administration, however, selecting only the properties you need is usually easier to read.
How to Check Open SMB Files for a Specific Share
Depending on the output available in your Windows environment, you may want to identify files belonging to a particular shared folder.
One practical approach is to retrieve the open files and filter the path:
Get-SmbOpenFile |
Where-Object { $_.Path -like "D:\Shares\Projects\*" } |
Select-Object ClientComputerName, ClientUserName, SessionId, Path
Change the path to match the location of your shared folder.
This can be useful when a large server has many shares and you only need to investigate one particular directory.
How to Connect Open Files with SMB Sessions
An open file and an SMB session provide different pieces of information.
Get-SmbSession focuses on established SMB sessions between the server and clients, while Get-SmbOpenFile focuses on files opened on behalf of those clients.
For example:
Get-SmbSession
Get-SmbOpenFile
The first command helps identify the active client sessions. The second helps identify files currently opened through those sessions.
This relationship can make troubleshooting much easier because you can move from:
- Client computer
- User account
- SMB session
- Open file
For a broader look at SMB client activity, you can also review our guide to checking SMB connections in Windows 11.
What to Do If a File Is Locked
If a user reports that a file is locked, first determine whether the file is genuinely being accessed through SMB.
Run:
Get-SmbOpenFile
Then identify the client computer, user, session, and file path.
Before terminating an active connection or closing an open file, confirm that the user has finished working with the file. Forcefully closing an active file can cause unsaved data to be lost or applications to behave unexpectedly.
A safer troubleshooting sequence is:
- Identify the open file.
- Identify the client computer.
- Identify the associated user.
- Contact the user if appropriate.
- Ask the user to close the application or file.
- Verify that the SMB file is no longer open.
Checking Shared Folder Configuration
If the open-file information does not match what you expect, review the shared folders configured on the computer.
You can use:
Get-SmbShare
This helps identify the SMB shares configured on the computer.
You can also review our guide on how to check shared folders in Windows 11.
If users can reach a share but cannot access specific files, permissions may also be involved. See our guide to checking shared folder permissions in Windows 11.
Check Network Discovery and File Sharing
Open-file troubleshooting is only useful when the underlying network sharing configuration is working correctly.
For Windows 11 file sharing, Microsoft recommends checking the network configuration, Network Discovery, File and Printer Sharing, and related services when troubleshooting network sharing problems.
If devices cannot discover each other on the network, review:
- Network Profile
- Network Discovery Settings
- File and Printer Sharing Settings
- Windows 11 Firewall Settings
Microsoft notes that a Private network profile allows the PC to be discoverable and supports file and printer sharing, while Public networks hide the PC from other devices.
Common Problems When Checking Open SMB Files
Get-SmbOpenFile Returns Nothing
An empty result does not necessarily mean that SMB is broken. It can simply mean that there are currently no files open through SMB that match the query.
Try opening a shared file from another computer and then run the command again.
The Remote Computer Cannot Access the Share
If the client cannot reach the shared folder at all, investigate the network connection, Network Discovery, file-sharing configuration, firewall settings, and permissions before troubleshooting open files.
The File Is Open but the User Cannot Be Identified Easily
Review the ClientComputerName, ClientUserName, and SessionId properties together. You can then compare the session with the output of Get-SmbSession.
The File Remains Locked After the User Closes It
Refresh the SMB information by running the command again:
Get-SmbOpenFile
If the file remains open, investigate whether an application, background process, or another client still has the file open.
Useful PowerShell Commands for SMB Troubleshooting
| Command | Purpose |
|---|---|
Get-SmbOpenFile |
View files currently open through SMB. |
Get-SmbSession |
View active SMB sessions. |
Get-SmbConnection |
View SMB client connections. |
Get-SmbShare |
List SMB shares configured on the computer. |
Get-SmbShareAccess |
View permissions assigned to SMB shares. |
Get-SmbClientConfiguration |
View SMB client configuration. |
SMB Open Files vs SMB Sessions vs SMB Connections
These three concepts are related but should not be confused.
| Item | What It Shows |
|---|---|
| SMB Connection | Client-side connection to an SMB server and share. |
| SMB Session | Established session between an SMB server and client. |
| Open SMB File | A file currently opened through an SMB session. |
Using all three perspectives can provide a more complete picture of network file activity.
Frequently Asked Questions
How do I check which files are open through SMB in Windows 11?
Open PowerShell with appropriate administrative permissions and run Get-SmbOpenFile. The command retrieves information about files open on behalf of SMB clients.
What PowerShell command shows open SMB files?
The primary command is Get-SmbOpenFile.
Can I find which computer has an SMB file open?
Yes. Review the ClientComputerName property or filter the command using the -ClientComputerName parameter.
Can I find which user opened an SMB file?
Yes. The ClientUserName property can help identify the user associated with the SMB file access.
Can I check files belonging to a specific SMB session?
Yes. If you know the session ID, use Get-SmbOpenFile -SessionId followed by the appropriate session ID.
Does Get-SmbOpenFile show files accessed over the network?
The cmdlet is designed to retrieve information about files that are open on behalf of SMB clients on an SMB server.
What should I do before closing an open SMB file?
Confirm that the associated user or application has finished using the file. Forcefully closing an active file can result in lost work or application problems.
Final Thoughts
Knowing how to check open SMB files in Windows 11 can make network file-sharing troubleshooting much easier. The Get-SmbOpenFile PowerShell command provides a direct way to investigate files currently opened through SMB and can help connect a file access problem to a client computer, user, and SMB session.
For more complete troubleshooting, combine open-file information with Get-SmbSession, Get-SmbConnection, and Get-SmbShare. This allows you to investigate SMB activity from several perspectives instead of relying on a single command.
If you are building a Windows 11 file-sharing troubleshooting checklist, continue with our guides on SMB sessions, SMB connections, shared folders, and shared folder permissions.

