Reputation: 1
We are using SharePoint 2016, and I am trying to upload a document called 'Risk Management.docx' to a File Directory but when I attempt to upload it it says 'The file https://location/Risk Management.docx' is checked out for editing by i:0#.w|domain/username'.
However, this user has been disabled in AD, and the file is not present at this location. I am unable to find this file anywhere. I have gone into the Central Admin portal and gone to the Content and Structure section of where this file should be, and it is also not present in there.
How would I 'unlock' this file, or enable the ability to upload to this location? It appears the file doesn't exist at all, so would I need to clear SharePoint's cache?
Any help would be appreciated.
Upvotes: 0
Views: 529
Reputation: 23
Since you are using SharePoint server, here is PowerShell code also.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Variables
$WebURL="https://intranet.crescent.com"
$ListName="Documents"
#Get Objects
$Web = Get-SPWeb $WebURL
$List = $web.Lists.TryGetList($ListName)
If($List -ne $Null)
{
#Get Checked out files with no checked in versions
$CheckedOutFiles = $List.CheckedOutFiles
Write-host "Total Number of Files with No Checkin version:"$CheckedOutFiles.count
#Loop through each checked out File
ForEach ($File in $CheckedOutFiles)
{
Write-Host -f Yellow "'$($File.LeafName)' at $($File.Url) is Checked out by: $($File.CheckedOutByName)"
#Take ownership
$File.TakeOverCheckOut()
#Check in
$List.GetItemById($File.ListItemId).File.Checkin("Checked in by Administrator")
Write-host -f Green "Took Ownership and Checked in the File!"
}
}
else
{
Write-Host -f Yellow "List '$ListName' Does not Exist!"
}
Don't forget to replace variables on your own site.
Upvotes: 0
Reputation: 1088
You can list documents saved by a user but no checked-in to the site.
Go to documents library Settings > Manage files which have no checked in version
. You can view, select and take control of theses files.
Upvotes: 0