Feature Request: Find checked out items/files in a given list/folder and force check in

Jun 3, 2014 at 4:04 PM
Here's the background behind this request:

I have a library with over 100,000 files within different folders. Some of the items were created and are sitting checked out in their folders with no first check in version. That means no one can see the file(s) except the creator.

When going to "manage files which have no checked in version" in the library settings, I hit the list view threshold since there are too many of these files in this checked out state.

In SP On-Premises, I can whip up different ways to fix this very quickly, but in SP Online, my hands are a bit tied and I'd have to use the CSOM.

Have a PowerShell cmdlet that forces check ins of several items at a given folder (recursively) would be a great time saver.
Jul 30, 2014 at 7:51 PM
tafs7 wrote:
Have a PowerShell cmdlet that forces check ins of several items at a given folder (recursively) would be a great time saver.
allright, let me check on that
Sep 2, 2014 at 3:25 PM
Edited Sep 2, 2014 at 3:26 PM
Hi,

it's quite easy to find all checked out files, you simply use a CAML query like this
<Where>
      <IsNotNull>
         <FieldRef Name='CheckoutUser' />
      </IsNotNull>
   </Where>
   <QueryOptions>
      <ViewAttributes Scope='RecursiveAll' />
   </QueryOptions>
When it comes to Powershell:
$spweb = get-spweb "XXX"
 $splist = $spweb.Lists.TryGetList("YYY") 
if ($splist) 
{ 
   $query = New-Object Microsoft.SharePoint.SPQuery; 
   $query.Query = 
   "   <Where>
      <IsNotNull>
         <FieldRef Name='CheckoutUser' />
      </IsNotNull>
   </Where>"; 
   $query.ViewAttributes = "Scope='RecursiveAll'"; 
   $items = $splist.GetItems($query); 
} 
Developer
Apr 12, 2015 at 8:06 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Marked as answer by kilasuit on 4/12/2015 at 4:20 PM