The file is currently checked out or locked for editing by another user Sharepoint + Or UPLOAD FAILED this file is locked for editing by domain\usrename

Introduction

The file is currently checked out or locked for editing by another user Sharepoint

The file is currently checked out or locked for editing by another user

It shows something like

File in Use
myfile.xlsm is locked for editing
by ‘domainname\yourname’
Open ‘Read-Only’ or click ‘Notify’ to open read-only and receive notification
when the document is no longer in use

Or UPLOAD FAILED this file is locked for editing by domain\usrename

The problem is, nobody else is editing this document, and the identified user (‘domainname\yourname’) is the name of the current user (the person opening the document right now) and sometime it shows other user name who editing earlier or editing currently

To release the locks from below script, go to your SharePoint server and execute the following script, you need to change site URL, relative URL of File in two place, This is “Ram Ban Oshdhi “ 100% fix the issue and will get your file unlock

Change the Site URL, Relative fiel URL and full file URL.

 

What can be caused?

  1. Word previously quit improperly and, therefore, did not delete the owner file. -or-
  2. A second instance of Word is running in the background with the document already open. -or-
  3. The document is shared over a network, and another user has it open. From my personal experience, I’ve found a combination of the first and third point above can recreate this error quite constantly
  4. The Microsoft Office products cashes while you were working on that particular document
  5. PC crashes while the document is open
  6. Loss of network connection (network issue) while document is open and your session is still live with editing mode
  7. If you have the preview pane turned on in Windows 7’s Explorer, you will get this error. Turning off the preview pane worked for me.
  1. Another case might be is like if first user with the file open is on Excel 2010; the second user is on Excel 2013 or any other version; perhaps there’s some incompatibility which causes the second user’s Excel to be unable to get the real name.KB2598143 for Office 2010 (different packs for 32 and 64 bits!) to fix the incorrect names in the message.
  2. If user maps to a network share on our SAN. And you run a terminal server with Office installed that utilizes the same network share on our SAN. If an end user is using an Office product, and then does not log off completely but rather X out, the the file is shown as locked by the person who installed Office on the terminal server
Change the Site URL, Relative fiel URL and full file URL. 
## Add SP Snapins 
Add-PSSnapin Microsoft.SharePoint.PowerShell 
 
## Get your Web Object 
$myWeb = Get-SPWeb https://collab.panasonicautomotive.com/sc10 
 
## Get your file that currently behaving strange “Relative URL” , copy URL including special char to replace Space 
$myFile = $myWeb.GetFile("Executive%20Weekly%20Reports/Mar%2027%2C%202017.docx") 
 
$myUserID = $myFile.LockedByUser.ID 
$myUser = $myWeb.AllUsers.GetByID($myUserID) 
 
##The following is the all-important piece, open the site as the user who locked the file and then release the lock 
 
$impSite= New-Object Microsoft.SharePoint.SPSite($myWeb.Url, $myUser.UserToken); 
 
$impWeb = $impSite.OpenWeb() 
 
## Get your full file reference in the given format, copy URL including special char to replace Space 
 
$fileURL = "https://mycompanysitename.com/sc10/Executive%20Weekly%20Reports/Mar%2027%2C%202017.docx" 
 
$impFile = $impweb.GetFile($fileURL) 
 
$impFile.ReleaseLock($myFile.LockId)

About Krishana Kumar

Krishana Kumar is SharePoint Architect/Trainer having Architecture experience with high volumes at Enterprise level and global scale - creation of highly scalable solutions with global user base and geographically distributed architectural components. Good knowledge of SharePoint best practices and governance models. I hold Two Master degree in Computer Science with over 11 years of experience working on Microsoft Technologies specially SharePoint, Project, .NET and other Information Worker Technologies. Having good exposer in Client side scripting Angular.js, backbone and Node. I am currently responsible for SharePoint Infrastructure set up and leading teams in various medium and large scale projects, architecting, designing & installing SharePoint farms, developing custom components,, and providing advanced SharePoint administration and development training to teams and customers. I regularly speaks in various SharePoint User Groups and other Events. I have MCSA Windows Azure, MCSA Office 365, MCSE & MCSD SharePoint 2013, Microsoft Certified Developer (MCD) and holds MCPD, MCTIP and MCTS for SharePoint 2010, MCTS MOSS 2007 & WSS 3.0, MCPD, MCITP (EPM 2010 & 2007) and MCSD .NET.
This entry was posted in General Interest. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *