Step 1: Disconnect User Disconnect user who is associated with the locked file from the machine they are currently using. (Normally you get the username from the lock error pop-up) Step 2: Connect to your File Server's File ServicesGo to your file serve r– Right Click My computer – Click Manage – Expand Server Manager – Click Roles – Click File Services
Step 3: Click on Share and Storage managementClick on the Share and Storage management.
Step 4: Close open sessionsUnder the actions menu on the right Click on “Manages Sessions…” , look for any related open sessions and close all of them
Step 5: Close Open FilesUnder actions menu on the right Click on “Manages Open Files…” , look for any related open sessions and close all of them
Step 6: Open your fileAt this point you should be ok to open your shared file now to edit.
Reference:
How to clear a shared file that is locked on a domain network - Windows Server - Spiceworks