SharePoint Experts, Information Architects, Expert Witness

We provide consulting in a broad array of business and technology from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. Specialists in Microsoft, we are a premier provider of SharePoint Expertise (including 2016 and Office 365). We also provide Expert Witness/Legal Expert in eDiscovery, source discovery, patent infringement, piracy and more! We also have established SICG DLDS s.a. - our counterpart in Costa Rica that specializes in water systems ( - Contact me direct: or call 704-873-8846 x704.

Search This Blog

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.

Saturday, October 28, 2017

Event 6398 - The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob

Like many of you know, SharePoint 2013 and 2016 comes up with some recurring issues from time to time - one of these is Event ID 6398:

"The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob..."

Seen in the event log, it looks like this:

I myself forget about this occasionally (thus why I am posting here!).

Fortunately, this is not a big deal - this just means that the Forefront Identity Manager Service is not running. From Administrative Tools, open the Services (or use Start > Run and enter services.msc). Look for the two Forefront services - you will see the Manager service is stopped:

Right click on the service and select Start - problem solved!


Started getting various errors in a User Profile Service:

Detection of product '{90150000-104C-0000-1000-0000000FF1CE}', feature 'PeopleILM', component '{1C12B6E6-898C-4D58-9774-AAAFBDFE273C}' failed

Fix is easy - just add the NETWORK SERVICE account to the WSS_WPG Group: Technet Fix