Showing posts with label take ownership. Show all posts
Showing posts with label take ownership. Show all posts

Tuesday, 7 October 2014

Batch check in multiple files with Powershell

I recently came across a problem where a user had migrated 10000 documents to a Team Site. The user hadn't turned off the check in/out in the library settings, so all the documents needed manually checking in.

This normally wouldn't be a problem. The user could either navigate to the manage content and structure page '/_layouts/sitemanager.aspx?' or, I could take ownership from library settings > Manage files which have no checked in version  '/_layouts/ManageCheckedOutFiles.aspx?' and check them in myself.

Unfortunately, from 'manage content and structure' you can only check in 2100 files at once. This is something to do with a SQL limit.

Instead I used the following PowerShell script. This iterates through all the folders in the library you specify, takes ownership of the files, then recursively checks in all files that are checked out.