I am unable to delete a locked file because it says it is checked out by a user. We verified the only user that has access does NOT have this open or checked out. This is in the 'Form Templates' Library that cannot be deleted from the browser.

I also looked into the Library Setting'Manage files which have no checked in version', but nothing shows up there. Any ideas on how to delete this file and/or library? Powershell or another workaround?

enter image description here


Check in the file then delete it:

#Variables for Processing
$SiteURL = "https://tenant.sharepoint.com/sites/michael"

$Password ="xxx"

#Setup Credentials to connect
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName,(ConvertTo-SecureString $Password -AsPlainText -Force))

#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = $Credentials

#Get the list by title

#Get the item to delete by ID
#Get the file to delete

#Check in and delete the file

Check for file checked out status and release lock if any

$spWeb = Get-SPWeb http://prinhyltphp0317/
$listName = "text"
$list = $spWeb.Lists |? {$_.Title -eq $listName}
foreach ($item in $list.Items) 
  $itemFile = $item.File
  if( $itemFile.CheckOutStatus -ne "None" )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.