Thursday, 16 October 2014

Create SharePoint Search Service Application With PowerShell


When the Search service application is created from Central Admin, all created Search databases have GUIDs at the end. I like to like to create Databases with a friendly name rather than a nasty GUID. If we create the Search service with PowerShell, we can specify the database names SharePoint uses. The following script will do this for you... 


The next step is to manually create the crawl component, and index partition and query component. Fortunately this only take a few seconds from the GUI.

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.