SharePoint Experts, Information Architects, Expert Witness

SICG provides a broad array of business and technology consulting from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. We focus on the "How", not just the possible. Contact me direct: or call 704-873-8846 x704.

Search This Blog

Saturday, November 24, 2018

The timer service failed to recycle

This is one I see all the time on client sites - under Review problems and solutions you see the message "The timer service failed to recycle". The problem is actually due to running other jobs that conflict with the recycle process - in short, something else is running.

Many have a habit of having long running jobs start after Midnight (00:00) which is generally around the time the Recycle job runs - if something else is running, the job fails. The solution is quite simple - either A) review and modify jobs that run at the same time as the Recycle job and make sure they don't overlap or B) simply change the time that the recycle happens. Since A may take some time, B is quite simple.

Open Central Administration and click Monitoring then Review job definitions and look for "Timer Service Recycle" (you'll have to page through to find it). Click to open the job and change the Starting time to be either earlier or later than other long running jobs. In most cases (depending on the installation and/or 24 x 7 usage), you can usually set it for late evening (like 10 PM).

For more reference, see here:

SharePoint Most Popular does not appear in Lists

As we all know, document libraries have the option to review Most Popular items. While there can be issues with this (showing no counts for example), it does work in most cases. Assuming you are getting counts, you might notice that this option does not appear in Lists.

Enabling this is easy enough - simply activate the Cross Site Publishing feature - Site Settings > Site Collection Features > Cross-Site Collection Publishing.

Saturday, November 10, 2018

ULS Logs Searching for the Correlation ID

Having forgotten about this myself, I am posting here. In many cases, there's instances where you want to scan across ULS in SharePoint for a single Correlation ID. Notepad/Notepad++ are not much help here since messages are mixed. The ULS Viewer isn't always the best either.

The proper way to help you narrow down what you are looking for is "Merge-SPLogFile". This little gem searches across the ULS logs and helps you dump it into a single file.

Format is simple (obviously run one of the farm servers):

Merge-SPLogFile - Path <File Path> -Correlation <Correlation ID> -Overwrite

Overwrite is optional - it simply overwrites an existing file. So for example:

Merge-SPLogFile -Path "c:\temp\MyLogsMerged.log" -Correlation 7d88815d-17d5-412d-a71d-f0d124c8ad7c -Overwrite

And you can add the date (or time):

Merge-SPLogFile -Path "c:\temp\MyLogsMerged-$(Get-Date -f yyyy-MM-dd).log" -Correlation 7d88815d-17d5-412d-a71d-f0d124c8ad7c -Overwrite

Now you can use this merged log file in the ULS viewer so you can take your time to review an entire event without having to filter.

There are actually a lot of things you can use to filter - Correlation is just one. It can be an Event ID, service name, etc. - see the details here:

Merge-SPLogFile on

Monday, November 5, 2018

Trouble adding a Custom Action in SharePoint 2016

Minor annoyances. I had this problem a while back and just haven't worked with it in a while so I figured I'd share.

When working with creating a Custom Action to add it to say the EditControlBlock, it's easy to make a common mistake. When you are adding it, you have to add it to the collection separately instead of directly on the list/library. So for example, this does not work (where DL is the Document Library to add to) - notice the bolded lines in each:

SPUserCustomAction TheCopyAction = DL.UserCustomActions.Add();
TheCopyAction.Title = "Copy to Extranet";
TheCopyAction.Sequence = 0;
TheCopyAction.Name = TheCopyAction.Id.ToString();
TheCopyAction.Url = "http://mdsp13sp2:83/hdtintra/eng/_layouts/15/copy.aspx?SourceUrl=http://mdsp13sp2:83{ItemUrl}&FldUrl=http://mdsp13sp2:83/eng/MyDocs/&Source=http://mdsp13sp2:83/hdtintra/eng/";
TheCopyAction.Location = "EditControlBLock";
TheCopyAction.Description = "Copy this file to the extranet site";

BUT, using the collection DOES work:

SPUserCustomActionCollection CustomActionCollection = DL.UserCustomActions;
SPUserCustomAction TheCopyAction = CustomActionCollection.Add();
TheCopyAction.Title = "Copy to Extranet";
TheCopyAction.Name = "Copy this file to the extranet site";
TheCopyAction.Sequence = 0;
TheCopyAction.Location = "EditControlBlock";
TheCopyAction.Url = "http://mdsp13sp2:83/hdtintra/eng/_layouts/15/copy.aspx?SourceUrl=http://mdsp13sp2:83{ItemUrl}&FldUrl=http://mdsp13sp2:83/eng/MyDocs/&Source=http://mdsp13sp2:83/hdtintra/eng/";

Oddly, you can see this in Designer - two added via C#, the first by the the top way and 2nd by the 2nd way:

Kudos to:
(after spending 3 hours on this due to failure of memory, thanks!)

Saturday, September 8, 2018

Get the Public Key Token for a strongly named assembly in Visual Studio

So this is a rehash of an older post by Jeremiah Clark - original URL at the bottom of this post.

I have often needed to get the Public Key Token of a strong named assembly and have always done it by hand using sn.exe or the folder method. So the issue is how to get the Public Key Token easily - particularly when you need to create a Safe Control or otherwise add it to the web.config file. Of course, you can always build it, deploy to the GAC and find it in the c:\Windows\\assembly folder under the appropriate folder:

GAC_32 = 32 bit
GAC_64 = 64 bit

You'll find it there and the Public Key Token is part of the folder name. However, this is a pain - so this method turned out to work outstandingly well.

Step 1 - Find where sn.exe resides - where it is depends on which version of Visual Studio you are running. Open the Developer Command Window and type in:

where sn.exe

In my case, it found it under c:\Program Files (x86)\Microsoft SDKs\Windows\v10.0a\bin\NETFX 4.6.1 Tools\sn.exe:

Step 2 - Open Visual Studio, click Tools in the tool bar then select External Tools. When the pop up opens, click Add. Set the Title, Command and Arguments:

Title = Get SN Token
Command = c:\Program Files (x86)\Microsoft SDKs\Windows\v10.0a\bin\NETFX 4.6.1 Tools\sn.exe (the path to sn.exe)
Arguments = -T $(TargetPath)

Next, click the Checkbox to Use Output Window

This looks like this:

Click OK to save it.

Step 3 - Get the Public Key Token. When the project is opened (and you've built it at least once), just click Tools in the tool bar and select Get SN Token - this opens the output window as shown:

Done deal!

Jeremiah's original post

Monday, May 28, 2018

Remote Desktop Access (On-Premise & Azure) Error "CredSSP Encryption Oracle Remediation"

So, recent update in Microsoft has broken RDP across the globe. It's not necessarily a server problem, but many (unfortunately) allow for Automatic Update on their laptop/desktop and Microsoft added this update without any notice. When you try to RDP (Remote Desktop Connection), the error is "CredSSP Encryption Oracle Remediation" - The error will look similar to this:

So, if you are using servers on-premise, the only fix is to a) run update on all systems you intend to use RDP with (laptops, desktops, etc.) then b) run update on ALL of the servers you intend to connect to. A REAL pain, but the only way to fix it properly. I know the pain - I had to spend an entire weekend running updates (some 'packaged' which always makes me nervous in what is actually in it) and test every server.

Now, if you are using Azure, you will come across the same error - this one is a bit tricky but fortunately, a post on this shows the fix:

Mitigation 1 was my choice - if you use this, after completing the change, open a command window as Administrator and run:

gpupdate /force

You need permissions to do this OR you have to talk to your system administrator(s) and get a global change.

Use Mitigation 2 ONLY if you have to!

UPDATE: Microsoft's May 2018 Security Update will fix this permanently however a reboot is required so plan accordingly - look for KB4103725 to download if it doesn't work with Windows Update (we had to try on a few servers several times - only accessible through the Hyper-V and VMWare consoles so were down for quite awhile; update would fail after 20 minutes or so).

Sunday, May 27, 2018

Start-SPAdminJob doesn't work

Old one but worth remembering - the Start-SPAdminJob doesn't work as you'd expect - entering the command by itself (and with -Verbose or any other options), you get an error (click the image to expand):

The fix is not really documented - you have to stop the SPAdmin (SharePoint Administration Services through Services.msc or PowerShell), run the cmdlet then start the service again. For 2013, it's:

Net Stop SPAdminV4
Net Start SPAdminV4

Remember too that for now, stsadm -o execadmsvcjobs still works (use the Management Shell so you don't have to change directories).

ALWAYS USE Run as administrator when opening the Management Shell for best results!

Friday, March 23, 2018

Generate a detailed report about every document in your site collection SP13/16

Like many of you, I've searched for many a way to find out what's in the SharePoint site. I had a specific need to get a list of documents in the site collection and was not able to access my own so I came across a post that turned out to be 'almost' what I needed but was crude in what it did.

Thus this, the enhanced script to generate a detailed report about every document in your site collection. This is an excellent tool for integration with CRM or LOB systems!

NOTE: You have to modify the Reflection to update to 16. This one is for 13:

Download the Script here

Tuesday, February 27, 2018

Screen Timeout in Windows Server

If you are like me, doing development on servers can be a pain when the screen keeps locking. Having to login again and again gets to be a real pain. I did find the solution for this and while I'd like to send a kudos, I cannot find the original link so I am documenting it here.

The default setting for Windows is to timeout after 1 minute - this can be very agitating when working on something. The purpose of this change is to a) Remove the password requirement and b) Disable the timeout (or  you can set the timeout to something longer like 10 minutes).

To start off with, you MUST login using the Administrator account. While an Admin account can change the Registry, power settings can only be changed by the Administrator.

Step 1: Modify the Registry

By default, the option to change the timeout is not available (and in fact not shown). To get this to show, we have to modify the registry setting to enable it.

Open a command window (running As Administrator) and enter Regedit (or use the Run command). When the Registry opens, navigate to:


Locate the GUID 7516b95f-f776-4464-8c53-06167f40cc99 and expand it. Next locate the GUID 8EC4B3A5-6868-48c2-BE75-4F3044BE88A7 and click to open it. On the right hand side, you'll see "Attributes":

Double click on Attributes and change the value from 1 to 2:

Click OK to save the change and close Regedit.

Step 2: Open the Control Panel

When you open the control panel, use the Search box to search for the word "power" - this will bring up the Power Options. Click on Change power-saving settings:

If you are not the Administrator, you'll know because the options will be grayed out:
As Administrator, this option is enabled - click Change plan settings:
Next, click the Change advanced power settings link:

The first option you can change is the Password on Wakeup - set this to Yes or No:

Scroll down to the 'Display' section - this is where you can set the timeout - by default, this is One Minute:

To disable completely, set this value to 0 otherwise you can set the value to however many minutes you want:

Click the Apply button and close everything out.

That's it! No more timeout!

Saturday, February 17, 2018

Status of DBCC Shrink or Shrink through the GUI SQL Server

A note so I don't forget - if while doing a Database Shrink, you may want to know the status - the TSQL command is this:

SELECT percent_complete, start_time, status, command, estimated_completion_time, cpu_time, total_elapsed_time
FROM sys.dm_exec_requests
WHERE command = 'DbccFilesCompact'

Here's the detail on the table:

The key field you may be interested in is estimated_completion_time - to get the hours/minutes, use this:

Select dateadd(s, convert(bigint, <value>) / 1000, convert(datetime, ''))

For example:

Select dateadd(s, convert(bigint, 162114) / 1000, convert(datetime, ''))

will return '1900-01-01 00:02:42.000', i.e. 2 minutes, 42 seconds.

Be aware that the estimated_completion_time is just that, estimated but it will give you a rough idea on if you should grab another cup of coffee or go out to lunch.

Sunday, February 11, 2018

The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator

You may catch this error when working with lists:

The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator

There are several fixes to this, most notably by updating the thresholds in the web application settings in Central Administration (on premise) but you can't do it on Online.

However, even working with both on-premise and online developing a 'recent file/folder/doc set' view tool, it became apparent that changing the view limits didn't make a difference anyway. 

For little queries (a single list with a few thousand items) you don't usually see this. However, if you are doing web wide, SiteColllection or Recursive queries, this becomes a real problem in a live site setup.

It turns out that it's all in the CAML query - yes, yet another anomaly we find that's never documented. So the issue that in the CAML query, we have to be careful what we use in terms of nesting - a query can be really long (for example, filtering out using <Neq> to eliminate specific file types - for example, xml, xsl, css using the DocIcon field) or short HOWEVER, if your CAML query includes both <And> and <Or> viola, you get the error.

My assumption here is that the OR query portion means there's too much hashing going on to properly calculate the number of rows it will return (FYI Row Limit doesn't fix this). 

The fix can be a pain but it works - make sure that you ONLY use <And>. This can complicate your queries but if you think them through, you can always work it out.

UPDATE: This MAY not fix it either. It turns out that if the database is exceedingly large (like over the limit), the error still occurs.

One other tidbit: 

If you are looking for recently created or modified files (and folders, etc.), be sure to only use the Modified date in the query (if you use Created then Or Modified, the query blows up as above). Remember that the Created/Modified dates are always filled when created so you do have add some logic to split them (i.e. If Created = Modified the status is "created" - if Modified greater than Created, status = modified).

Thursday, February 1, 2018

Add a page title to your master page (SharePoint & SharePoint Online)

Ever get a bit annoyed with the ribbon in SharePoint blocking the page/list/whatever title? Can't tell what folder (gasp you use folders?) you are in? It can be quite difficult for new users. So quick fix - simply edit your Master to add a little snip it as follows.

Edit your master using Designer. Make a copy of the master you are using now and create a new one. In the code, find the line below and paste in the code snippet - modify the style as you see fit:

<SharePoint:AjaxDelta runat="server" id="DeltaSuiteLinks" BlockElement="true" CssClass="ms-core-deltaSuiteLinks">

<span id="pageDisplayName" style='text-align:left;'></span>
<style type="text/css">
.TopPageLinkStyle { font-weight:bold; text-decoration:none; }
a.TopPageLinkStyle { color:#ffffff; }
a.TopPageLinkStyle:visited { color:#ffffff; } 
a.TopPageLinkStyle:hover { color:#00FFFF; } 
a.TopPageLinkStyle:active { color:#00FFFF; } 
<script type='text/javascript'>
var trimIt = document.title;
if (trimIt.length > 0)
var pgUrl = window.location.href;
var dispIt = trimIt;
document.getElementById("pageDisplayName").innerHTML = "Current Location: <a href='" + pgUrl + "' class='TopPageLinkStyle'>" + dispIt + "</a>" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";;

<div id="suiteLinksBox">

Save your new master and publish it. Navigate to your site and try it out on a sub site - the result should be something like this:

Notice that the name is a link - it allows one click away from going back instead of having to click the ribbon. Also, check it out in a List! Enables getting back to the main view quickly (and includes it in the title):

Tuesday, January 23, 2018

Using SharePoint Web Services from Anonymous Mode

NOTE: This is only applicable to on premise.

You might have a need to access the SharePoint Web Services (in my case it was the UserProfileService.asmx) from an anonymous site. The issue is authentication - through both CSOM and Server Side code, there are problems with authentication.

A test with elevated, impersonation using a token and impersonation in .NET failed to produce results. In all cases, the permissions were blocked (user not part of the site, etc.). The actual fix was from a post I stumbled on wherein you can add a section to the Web.config to make it work.

Look for the end tag </system.web.extensions> and add the following just below it:

<!-- Disable anonymous access to _vti_bin -->
<location path="_vti_bin">
            <deny users="?" />

This effectively blocks anon-users from accessing _vti_bin (a good thing anyway) but permits the web services to work (you still need to set network credentials).

FYI: You should be using SPWebConfigModification to make the change - while I've documented this myself, here's another quick guide:

Kudos to:

Wednesday, January 17, 2018

Getting the Public Key Token for a DLL (and where the heck is sn.exe?)

An oldie but a goodie...(and for my own memory). To get the Public Key Token for a DLL is to simply use the "Strong Name Tool" (more from Microsoft here:

The SN.exe tool can be found under the SDK's folder, under C:\Program Files (x86)\Microsoft SDKs\Windows. You can simply open the folder and search for sn.exe and pick the latest based on what version of .NET you have. For example, it's C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools.

Note: If you use the Developer Command Window, the path will already be loaded.

Simply navigate to the folder where the DLL is and enter:

sn  -T <ddl name>.dll


sn -T MyNewDLL.dll

* If you don't know where the DLL is, you can find it under the bin\debug or bin\release folders in your Visual Studio project.