Managing open files on a Windows Server is crucial for administrators to monitor file access, troubleshoot issues, and ensure the efficient operation of file-sharing services. Whether you’re handling file server workloads or diagnosing performance issues, being able to see which files are open, which users are accessing them, and the operations they are performing can help maintain a stable and secure environment.
Windows Server offers several tools and utilities to manage and view open files, most notably through the Computer Management console, PowerShell, and command-line utilities like Net File. These tools allow administrators to track open files, close them if necessary, and manage access controls for users and groups. They can also assist in troubleshooting locked files or in situations where a userβs session needs to be terminated due to file access issues.
While the core process for managing open files remains relatively consistent across Windows Server versions from 2012 onward, there are some differences in the tools and interfaces provided by each version. For instance, newer versions like Windows Server 2016 and 2019 include enhancements to file-sharing services, security, and performance, but the fundamental techniques for viewing and managing open files, whether using the GUI or command line, remain largely the same.
This guide will cover the tools available across different versions of Windows Server, highlighting key differences and best practices to efficiently manage open files.
Using Computer Management
Using Computer Management is by far the easiest way to view and manage files in Windows Server.
In Windows Server 2012, you can access Computer Management by doing the following:
Right-click on the Start Button and select Computer Management.
Alternatively, you can access computer management in older versions of Windows server by:
Holding down the Windows Key + R. This should open the Run box. Inside, type βcompmgmt.mscβ and press enter.
Computer Management can also be accessed via command prompt by typing:
βmmc compmgmt.mscβ
Once inside Computer Management, you can view open files by going to:
System Tools > Shared Folders > Open Files
This pane will display a list of all open files being accessed on that server in a Windows Server environment. Inside, youβll see the directory path of the file being accessed, the userβs username, the fileβs status, and the number of locks on the file.
Often, staff will open files and then leave for lunch or simply forget that they have files open on their desktop. This can create a problem for anyone else who needs to access that file and make changes.
To close an open file, simply right-click on the file and click Close. This will kill the userβs sessions and make the file available to other users again. Keep in mind, that if you have other file servers, you will need to complete these steps on the file server where the files are being hosted.
Alternatively, you can use the Snap Ins function to add multiple files servers and manage everything centrally.
To do this, add Shared Folders under the βavailable snaps-insβ section. Next, choose the option for βAnother computerβ and input the hostname of the fileserver. Finally, you can choose to view open files, shares, sessions, or all three.
Using Resource Monitor
Another way you can view and manage open files in Windows Server is to access the Resource Monitor. Using the Resource Monitor allows you to record file activity if needed but doesnβt allow you to close open files.
You can access the resource monitor by searching for it under the search by in the Start menu. Alternatively, you can launch it by typing βresmonβ into the Run box or command prompt.
Once in Resource Monitor, you can view and manage open files by selecting the Disk tab. Here youβll be able to see what file is open, its disk usage, and the fileβs directory path.
Managing Files on a Remote Desktop Server
If you manage a Windows remote desktop server, you can sometimes manage file access through Task Manager. This is useful for users who leave files open in Word or Excel and donβt correctly log off. This method doesnβt provide you with granular control as Computer Management but is quick and convenient if youβre already on the server.
On the remote desktop server right click on the taskbar and select Task Manager. Next, select the User tab. If you suspect a specific user has a file open, choose that user. Often Word or Excel documents will display the username of the person who has the file locked.
Expand the arrow to the left of their name to see a list of all user processes running in their session. For example, if you need to close an open Excel file, you can kill that process in their session to free up the locked file.
Keep in mind that the user may have more than one file open in that application, which could cause them to lose unsaved work. While this method is convenient, it isnβt as reliable or as accurate as Computer Management.
Viewing Files in Command Prompt
Seasoned IT pros will know that you can view files directly inside the command prompt. If youβre a fan of CLI or simply arenβt a fan of the new Windows Server interface, knowing a few simple syntaxes will enable you to view open files and perform simple maintenance tasks.
Click on Start and search for Command Prompt. Next, right-click on Command Prompt and choose βRun as administratorβ. If you do not have administrator privileges, this command will not work.
Using the openfiles syntax, we can query for files, see the results, and disconnect files from the command prompt.
To view open shared files, type βopenfiles /queryβ. In addition, you can view a more detailed list of open files by using the following command:
βopenfiles /query /fo table /nhβ
Make a note of the ID, user, and directory of interest. From here, you can issue commands to close those files. For example, you can disconnect all open files by a particular user by typing:
βopenfiles /disconnect /a usernameβ
If youβre looking to close a particular file regardless of the user, you can find the open file ID when you query all open files. Make a note of the open file ID and run the following command to close that file.
βopenfiles /disconnect /id XXXXXXXβ
The openfiles command is a flexible way to manage files from the command line interface. Although, at the same time, it can take some time to learn the syntax, and it can prove to be a reliable alternative to the Computer Management option
Tools to View and Manage Open Files
There are numerous paid and free tools available to manage and view open files on Windows Server. These tools are designed to add additional functionality beyond the built-in option inside Windows Server.
1. Clover
Clover is an extension for Windows Explorer that makes navigating Windows file management options more straightforward and convenient. This extension adds multi-tab functionality and drop-down menus to Explorer to improve the default GUI of Windows Server.
If you continuously monitor file access, Clover can speed up the process by offering customized tabs, a favorites section, and numerous keyboard shortcuts that allow you to toggle between menus quickly.
Clover is entirely free, making it an excellent option for smaller budget-conscious organizations.
2. Explorer ++
Explorer ++ is a free and open-source add-on that enhances file manager on Windows Server and Windows workstations. The platform is highly customizable and makes viewing details about open files much easier than the default view.
Like Clover, you can tab between browsers and manage multiple folders from a single window. In addition, you can view and manage open files similarly to File Explorer, with the added benefit of bulk file modification and centralized file management.
Explorer ++ is a great way to enhance windows file management for open files for smaller environments. In addition, since the product is open-source, you can verify the code yourself before installing it on your file server.
3. SolarWinds Server & Application Monitor
SolarWinds Server & Application Monitor (SAM) allows administrators to centrally manage applications, files, containers, and hosts across multiple networks. The file activity monitor, in particular, provides a sysadmin to track open files and changes across those files in real-time.
While Windows does a decent job highlighting open files in Computer Management, SAM provides customized templates and visualization to track file performance and open files viable for larger organizations.
SAM also allows you to build automated actions and integrate with ITSM or helpdesk solutions. For example, if you or your staff find yourself repeating tasks regularly, you can leverage the automation features in SAM to streamline that workflow.
SAM is a powerful tool for file management and file server performance monitoring and shines in larger enterprise environments.
Ξ€est-drive SolarWinds Server & Application Monitor (SAM) with a fully functional 30-day free trial.