Share via

"Locked for Editing" by "Another User"

Kitano 75 Reputation points
2026-02-13T11:34:15.2+00:00

Files in our SharePoint Online document library are becoming "locked for editing" even when no one else has the file open. When a user tries to open or move the file, they get an error saying: "The file is currently in use by another user" or "This file is locked for editing by 'Unknown User'."

Is there a way for a SharePoint Site Owner to force-release a file lock through the UI or a specific PnP PowerShell command without having to delete and re-upload the file?

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

Answer accepted by question author
  1. Jayden-P 17,875 Reputation points Microsoft External Staff Moderator
    2026-02-13T12:24:50.91+00:00

    Hi @Manage BU

    Thank you for reaching out to Microsoft Q&A.

    After doing some research, I found this article might help.

    How to Unlock a File in SharePoint Online: Fix Ghost Locks Fast

    Note: This information is provided as a convenience to you. These sites are not controlled by Microsoft, and Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please ensure that you fully understand the risks before using any suggestions from the above link.

    This article provides some basic methods such as wait until ghost lock is timed out (usually 10 minutes), discard check-out to advanced methods like using PnP PowerShell (If basic methods work then you don't need to use advanced steps).

    If PnP is the last option, use this one. Set-PnPFileCheckedIn | PnP PowerShell

    $fileUrl = "/sites/[sitename]/Shared Documents/MyLockedFile.docx"
    Set-PnPFileCheckedIn -Url $fileUrl -CheckinType MajorCheckIn -Comment "Forcibly checked in by Admin"
    Write-Host "File has been checked in."
    
    

    Please refer to the article above for more details.

    I hope this information helps.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.