SharePoint 2013 – PowerShell Script to Move all Documents Between Libraries

I recently had a requirement to move all the contents of a document library to another library and anybody that has had the displeasure of having to move files in SharePoint knows what a pain that can be.

To make matters worse, due to the specific setup I was dealing with the ‘Content & Structure’ tool was a non-option as it wasn’t functioning correctly and there were a large number of nested folders in the source library. Luckily this gave me the chance to use one of my favourite power tools – PowerShell.

This article contains a script which will copy all contents of a single library to another library,  by using the built-in MoveTo command where possible so no data is lost or by copying if the source and target libraries are in different site collections.

Continue reading “SharePoint 2013 – PowerShell Script to Move all Documents Between Libraries”


SharePoint – Update-SPProfilePhotoStore UserProfileApplicationNotAvailableException Error

SharePoint’s method for updating user profile pictures can’t exactly be classed as the most straightforward process and I’ve seen a few issues with it over time.

In this article, I will cover the UserProfileApplicationNotAvailableException error and how to resolve it.

Continue reading “SharePoint – Update-SPProfilePhotoStore UserProfileApplicationNotAvailableException Error”

SharePoint – Enabling Versioning and Version History in all Document Libraries using PowerShell

The script below can be used in order to enable versioning in all SharePoint document libraries and also to set how many major versions to retain and how many minor versions to maintain.

it’s important to keep in mind when choosing how many minor versions to retain that the setting actually specifies how many ‘Major Versions’ drafts’ should be retained and not a hard limit on how many ‘draft versions’ will be kept.

Continue reading “SharePoint – Enabling Versioning and Version History in all Document Libraries using PowerShell”

SharePoint 2013 – How to Add a Home Button and Current Site Title to the Top Bar

Today I’ll be demonstrating (and providing code) on how to add a SharePoint home button which will allow your users to easily navigate to the SharePoint homepage from anywhere and also to add the current site’s title with a link to the current sites homepage.

This will require some basic knowledge of HTML, PowerShell, JavaScript and access to the SharePoint server, I’ll hopefully make this clear enough for anyone to follow though.

Continue reading “SharePoint 2013 – How to Add a Home Button and Current Site Title to the Top Bar”

SharePoint – How to Bulk Approve Folders using PowerShell

Admittedly this isn’t something you’d often need to do however I had a request to bulk approve folders and found very little information on how to do this in SharePoint using PowerShell so had to come up with my own way to do it.

Hopefully this helps –

Continue reading “SharePoint – How to Bulk Approve Folders using PowerShell”

SharePoint 2013 – How to Hide Taxonomy Columns

I was recently tasked with finding out how to hide the taxonomy catchall columns that appear when Content & Structure is used to move items into a list or library. These type of fields can’t be hidden using the normal SharePoint interface meaning our next best option is to use PowerShell.

I’ll cover how to use PowerShell to hide this column down below.

Continue reading “SharePoint 2013 – How to Hide Taxonomy Columns”

SharePoint – How to Modify SharePoint Lists and Libraries Using PowerShell

I had a request to rename roughly 100 libraries in our SharePoint deployment recently and thought it would be a good time to dig into a bit of PowerShell.

In this post I’ll demonstrate how to loop through site collections, subsites, lists and finally how to filter and change a name of a list and I’ll also attempt to show a few interesting properties we can change.

Continue reading “SharePoint – How to Modify SharePoint Lists and Libraries Using PowerShell”

How to fix ‘Invalid Trace Directory’ errors

As part of the migration process I’ve been going through the event logs for our CRM deployment to ensure everything is working correctly, during this I came across an ‘Invalid Trace Directory’ error (event id 17203) which was showing the following –

Invalid Trace Directory. Additional Info:[ Invalid Trace Directory (Reporting Process:Trace Diretory is Null. TraceSettings: {Filename:  ,FileCountSuffix:1 ,TraceFileSize:10485760 ,TraceDirectory: ,TracingCallStack:No ,IsTracingOff:Yes ,LoadState:LoadSuccessfulUnreported ,RefreshTraceInt:-1 ,SiteWideRefreshTraceInt:-1 ,RegistryRefreshTraceInt:6 ,Precedence:Default} ] , AppDomain:CrmAsyncService)

This error is because by default the Trace Directory will be set to ‘C:\crmdrop\logs’ which doesn’t normally exist (but you can just create it for a quick fix, I’d suggest changing it using the instructions below though).

Although this error doesn’t cause a huge issue it can keep producing quite a few errors in the event log which nobody likes to see –


Now this is pretty easy to resolve using a bit of PowerShell as I’ll show below.

Continue reading “How to fix ‘Invalid Trace Directory’ errors”