A file is locked open by a user who has gone home
A session is holding the file open. The lock can be cleared from the server without restarting anything.
What you see
"The document is locked for editing by another user" naming somebody who is not there, or a file that cannot be moved or deleted.
What is actually wrong
A workstation that lost its network connection without closing the file, a crashed application, or an opportunistic lock that was never released.
Codes and articles
The fix
Find and close the handle
A specific file is locked.
Find the open handle and who holds it.
Get-SmbOpenFile | Where-Object Path -like '*budget*' | Format-Table SessionId,ClientComputerName,ClientUserName,Path -AutoSizeCheck whether the user is genuinely gone before closing it — closing a handle on a file somebody is actively editing loses their unsaved work.
Get-SmbSession | Where-Object ClientUserName -like '*jbloggs*' | Format-Table ClientComputerName,ClientUserName,NumOpens,SecondsIdleThe SecondsIdle figure is the deciding number. A session idle for hours is safe to close; one idle for seconds belongs to someone typing into the document right now.
Close the specific handle.
Get-SmbOpenFile | Where-Object Path -like '*budget*' | Close-SmbOpenFile -ForceIf the lock persists, close the whole session for that machine.
Get-SmbSession -ClientComputerName WS042 | Close-SmbSession -ForceFor Office files, check for an orphaned owner file, which keeps the lock message appearing even after the handle is gone.
Get-ChildItem '\\fs01\share' -Recurse -Force -Filter '~$*' -ErrorAction SilentlyContinue | Format-Table FullName,LastWriteTimeIf this happens frequently to the same share, look at whether the clients are losing connectivity — repeated orphaned locks are a network symptom, not a file server one.
Get-SmbOpenFile | Where-Object Path -like '*budget*'Related faults
Where this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.