Category Archives: SharePoint 2010

Microsoft SharePoint Server 2010

Testing how new document versions are handled when sent to a SharePoint 2013 Records Center

There are a number of EDRM configuration options in SharePoint 2013 including ‘In-Place’ Records Management (IP-RM) and submitting documents to Records Centers (copying, moving, or moving and leaving a link). Detailed below is how a Records Center can be used to capture each document version as a record, whilst allowing the original document to continue to be updated.

Test 1: Submitting a copy of each major version of a document to a Records Center records library
1)  Upload ‘Caboodle TC’ document to a document library configured with a ‘Project Document’ content type and Major Versioning.

2)  Send a copy of ‘Caboodle TC’ to the Records Center.

3)  Check the Records Center Content Organizer rule correctly added the item to the ‘ProjectDocs’ records library.

4)  Update the original ‘Caboodle TC’ document to create a Version 2.0. Re-send a copy to the Records Center and check the Records Center ‘ProjectDocs’ records library.

The result is SharePoint adds the new major version to the same ‘ProjectDocs’ records library, but appends a unique code to the name of the copied item. The Records Center therefore stores a record per submitted version.

Test 2: Submitting a copy of each major version of a document to a Records Center records library
1)  Upload ‘ExcelDocument’ document to a document library configured with a ‘Project Document’ content type and Major Versioning.

2)  Send a copy of ‘ExcelDocument’ to the Records Center.

3)  Check the Records Center Content Organizer rule correctly added the item to the ‘ProjectDocsLibrary’ document library.

4)  Update the original ‘ExcelDocument’ document to create a Version 2.0. Re-send a copy to the Records Center and check the Records Center ‘ProjectDocsLibrary’ document library.

The same behaviour is exhibited, i.e. SharePoint creates a new item with an appended unique code in the ‘ProjectDocsLibrary’ within the Records Center. The Records Center therefore stores a record per submitted version.

So in conclusion, it is not possible to ‘overlay’ a superseded document version in the Records Center – separate items are always created. The only way around this would be using code/custom workflows. If In-Place RM was used to declare a published and approved item as a record, there would have to be a custom workflow process that un-declares the record to allow edited updates. The workflow would then manage the re-declaration of the In-Place record after it is re-published.

If records need to be declared, the workflow and custom development approach has to be recommended. I am personally in favour of using the Major & Minor Versioning and Content Approval capabilities of a standard document library without RM. You can still apply retention schedules and audit track events. The security trimming ensures that only relevant users can update the document and view draft copies. Only published/approved documents can be visible to the majority users by browsing or through search. Using the Search Results Web Part we can ensure that users always see the latest published version, whilst document owners can continue to work on draft versions.

If RM is not used in SharePoint you lose the ability to place holds on records and you lose the extra assurance that a document cannot be edited. However, the holds could be achieved programmatically with documents. The assurances can be derived from good security and auditing. I would therefore suggest that Records Centers are only used for the longer-term archiving of important or vital records, such as information on asbestos that needs to be kept for 50 years, or financial documents that need to be kept for 6 years etc. In-place records should only be used when documents no longer need to be updated, but the original context of the storage location needs to be retained.

How to create a Three Lines Search Display Template

Before starting ensure the SharePoint Server Publishing Infrastructure site collection feature is activated:

1.  Access SharePoint Designer 2013. Open the site to add a new search display template.

2.  Click on “All Files” and “_catalogs” and “masterpage” and “Display Templates” and “Content Web Parts”:

SharePoint Designer 2013 Display Templates

3.  Select the display template to base the new display template on. In this example I have created a new display template based on the “Item_TwoLines.html” file. Right-click and select “Copy”. Right-click and select “Paste”. (Note: The JavaScript pair file is created automatically).

4.  Select the copied item and rename it e.g. “Item_ThreeLines.html”. Wait for the JavaScript to correctly copy (use the Refresh function). Ensuring the new renamed html item is selected, right-click and select “Check Out”.

5.  With the item selected right-click and select “Edit File in Advanced Mode”. The Advanced Editor displays the HTML.

The updated “Item_ThreeLines.html” appears as below. The highlighted elements indicate what has been added to the Item_TwoLines.html code:

<html xmlns:mso=”urn:schemas-microsoft-com:office:office” xmlns:msdt=”uuid:C2F41010-65B3-11d1-A29F-00AA00C14882″>
<title>Three lines</title>
<!–[if gte mso 9]><xml>
<mso:TemplateHidden msdt:dt=”string”>0</mso:TemplateHidden>
<mso:ManagedPropertyMapping msdt:dt=”string”>&#39;Link URL&#39;{Link URL}:&#39;Path&#39;,&#39;Line 1&#39;{Line 1}:&#39;Title&#39;,&#39;Line 2&#39;{Line 2}:&#39;Title&#39;,&#39;Line 3&#39;{Line 3}:&#39;&#39;,&#39;FileExtension&#39;,&#39;SecondaryFileExtension&#39;</mso:ManagedPropertyMapping>
<mso:MasterPageDescription msdt:dt=”string”>This Item Display Template will show a small thumbnail icon next to a hyperlink of the item title, with an additional line that is available for a custom managed property.</mso:MasterPageDescription>
<mso:ContentTypeId msdt:dt=”string”>0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
<mso:TargetControlType msdt:dt=”string”>;#Content Web Parts;#</mso:TargetControlType>
<mso:HtmlDesignAssociated msdt:dt=”string”>1</mso:HtmlDesignAssociated>
<mso:HtmlDesignStatusAndPreview msdt:dt=”string”>http://hsweb01/sites/navigate/_catalogs/masterpage/Display Templates/Content Web Parts/Item_ThreeLines.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>
<mso:HtmlDesignConversionSucceeded msdt:dt=”string”>True</mso:HtmlDesignConversionSucceeded>
Warning: Do not try to add HTML to this section. Only the contents of the first <div>
inside the <body> tag will be used while executing Display Template code. Any HTML that
you add to this section will NOT become part of your Display Template.
<script> $includeLanguageScript(this.url, “~sitecollection/_catalogs/masterpage/Display Templates/Language Files/{Locale}/CustomStrings.js”);
Use the div below to author your Display Template. Here are some things to keep in mind:
* Surround any JavaScript logic as shown below using a “pound underscore” (#_ … _#) token
inside a comment.
* Use the values assigned to your variables using an “underscore pound equals”
(_#= … =#_) token.
<div id=”ThreeLines“>
var encodedId = $htmlEncode(ctx.ClientControl.get_nextUniqueId() + “_3lines_”);
var linkURL = $getItemValue(ctx, “Link URL”);
var iconURL = Srch.ContentBySearch.getIconSourceFromItem(ctx.CurrentItem);
var line1 = $getItemValue(ctx, “Line 1”);
var line2 = $getItemValue(ctx, “Line 2”);
var line3 = $getItemValue(ctx, “Line 3”);
var containerId = encodedId + “container”;
var pictureLinkId = encodedId + “pictureLink”;
var pictureId = encodedId + “picture”;
var dataContainerId = encodedId + “dataContainer”;
var line1LinkId = encodedId + “line1Link”;
var line1Id = encodedId + “line1”;
var line2Id = encodedId + “line2”;
var line3Id = encodedId + “line3”;
<div class=”cbs-Item” id=”_#= containerId =#_” data-displaytemplate=”Item2Lines”>
<a class=”cbs-ItemLink” title=”_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_” id=”_#= pictureLinkId =#_”>
<img class=”cbs-Thumbnail” src=”_#= $urlHtmlEncode(iconURL) =#_” alt=”_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_” id=”_#= pictureId =#_” />
<div class=”cbs-Detail” id=”_#= dataContainerId =#_”>
<a class=”cbs-Line1Link ms-noWrap ms-displayBlock” href=”_#= linkURL =#_” title=”_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_” id=”_#= line1LinkId =#_”>_#= line1 =#_</a>
<div class=”cbs-Line2 ms-noWrap” title=”_#= $htmlEncode(line2.defaultValueRenderer(line2)) =#_” id=”_#= line2Id =#_”>_#= line2 =#_</div>
<div class=”cbs-Line2 ms-noWrap” title=”_#= $htmlEncode(line2.defaultValueRenderer(line3)) =#_” id=”_#= line3Id =#_”>_#= line3 =#_</div>

6.  Save the edited “Item_ThreeLines.html” file. Check In the file and publish as a Major Version.

7.  If updated correctly, the new Display Template will appear in the “Content Search” Web Part properties. Select the display template name e.g. “Three lines”, as shown below:

Content Search Web Part Display Template Properties

8.  Expand the “Property Mappings” and tick the “Change the mapping of managed properties…” tick box. Note that a Link URL and Line 1, Line 2, and Line 3 appear based on the HTML changes. Click the drop-down menus to select available managed properties. On my example I have chosen to display a custom managed property called “DEVBMSID”, Title and UIVersionStringOWSTEXT (Version Number).

9.  To ensure that the Content Search Web Part only displays relevant documents click on the “Change Query” button in the “Search Criteria” section. Use the Quick Mode query builder or switch to Advanced Mode and enter search syntax – see example below:

Content Search – Build Your Query

10. You can test the results before clicking the “OK” button to save the search. Note: Refiners and Sorting can also be defined.

11. Ensure the “Number of items to show” is set to a suitable number – otherwise not all search results will be displayed.

12. Finally click on the Content Search Web Part properties “OK” button to save all settings.


Create a SharePoint content database in SQL Server

There are several ways of creating a SharePoint content database. First you can create a content database via the SharePoint Central Administration console. However this approach disregards any settings the DBA may wish to employ based on the SQL Server model database. Even if the “Model” system database is configured in SQL Server, the content database will not pick up the autogrowth settings. So the preferred approach for IT Pros is for the DBA to first create the content databases in SQL Server itself. The System Administrator can then create web apps and site collections that reference these databases. Taking this approach, what options are available?

1)      Use PowerShell scripts to create the content databases.

2)      Create the databases in SQL Server directly.

For Option 2, I recommend you watch the following video that explains step-by-step how to do this – see “Tuning SQL Server 2012 for SharePoint 2013 – Best Practices for SQL Server Database Settings” at

Things to bear in mind:

1)      Set the Model system database with your default Initial database and log Initial Size and Autogrowth configuration settings:

2)      Ensure the Model system database “Options” Recovery model is set to “Full” on the Production Server:

3)      Set the correct Collation, so that SharePoint web apps and site collection can pair up with the content databases.

4)      Now the SharePoint System Administrator can start creating site collections in Central Admin or PowerShell and pair with the newly created content databases.

Note: Ensure that if content databases are taken “Offline” (to avoid site collection pairing) that they are brought back to “Ready” when done; otherwise search crawls etc. will exclude the content databases. You can also set the maximum number of site collections on a content database to ensure that a new site collection does not pair with the content database.

The PowerShell approach is explained further in the following references:

Reference Link
SQL Server PowerShell Provider
Add content databases in SharePoint 2013
SQL Server Community (Toad World)


SharePoint Roles & Responsibilities – A Quick Overview

It is often not fully recognised how many different roles need to be appointed to manage a SharePoint deployment. Below is a quick list of common roles and responsibilities:

Role Responsibility Comments
SharePoint System Administrator Responsible for SharePoint Farm administration, including installation/deployment, managing Web Apps, Content Databases, Site Collections, Security, Backups etc. Typically a 1FTE IT function specific to SharePoint administration.
Active Directory (AD) Administrator Responsible for managing Active Directory OU’s, User & Groups, Distribution Lists etc. IT function – an existing role that is involved in the planning and administration of AD for SharePoint. The role may extend to security management in general using products like Microsoft’s Forefront Identity Manager (FIM), Claims-based authentication, and Anti-Virus protection.
Database Administrator (DBA) Responsible for managing SQL Server environment, including creation and monitoring of content databases, log files etc. IT function – typically an existing role that is involved in the planning, administration and monitoring of SharePoint SQL Server database tables.
Infrastructure Administrator Responsible for servers and network infrastructure. IT function – an existing role that is involved in the planning, administration and monitoring of SharePoint servers and network infrastructure.
Business Analyst Responsible for defining business requirements. IT or Business function – produces functional requirements.
SharePoint Architect Responsible for designing and configuring SharePoint site structure, metadata architecture, page layouts, security model etc. Works closely with SharePoint Developers translating requirements to solutions. IT function – needs a thorough understanding of SharePoint (admin, developing functions) including when and how new components and web parts should be developed.
Technical Architect Responsible for designing and configuring SharePoint server farm to support business requirements. IT function – performance monitoring, capacity planning, server maintenance etc.
Search Administrator Responsible for administering SharePoint Search – including content sources, result sources, search schema, index crawls, Search Centre configuration etc. IT function – may be part of SharePoint System Administrator role (depending on scale and type of deployment).
Backup/Restore Administrator Disaster Recovery Planning – Management of routine database backups, monitoring and database restores. May extend to management of file systems if Remote Blob Storage (RBS) is used. IT function – may be part of SharePoint System Administrator role, or DBA, or Infrastructure Administrator role (depending on scale and type of deployment).
SharePoint Developer Broad software development role – including custom application development for sandboxed solutions, systems integration, custom web parts and component development. IT function – experience typically includes Asp.Net, C#.Net, Ajax, JavaScript etc.
SharePoint Web Designer Customization of the SharePoint solution such as re-branding, using products such as SharePoint Designer – some programming skills. IT function – experience typically includes HTML, style sheet, CAML, XML, XSLT, JavaScript etc.
Site Collection Administrator Responsible for administering site collection – may include management of permissions, web design, search, content types & columns, monitoring/reporting, functions etc. IT or Business Function – requires Site Administration and Governance training.
Site Owner Similar responsibility as Site Collection Administrator, but specific to the site or workspace. For example, Site Owner may be a Project manager responsible for their project workspace. Typically a Business Function – may be the same person as Site Collection Administrator.
Power User Creates and configures lists, libraries, web parts, permissions, features etc. Good all-round knowledge of SharePoint product capabilities. Often allowed to create sub-sites or workspaces. Typically an IT savvy Business user, who acts as a local department or team “champion”. Fully conversant in SharePoint Governance policies & standards.
End-User Information workers. Those who use SharePoint on a day-to-day basis, also working with other products & technologies such as MS Office and scanning solutions. Business users who adopt SharePoint for the collaboration and sharing of information.
Trainer Responsible for training different roles how to administer and use SharePoint, in line with agreed SharePoint Governance directives. In-house trainers or external training organisation, such as Combined Knowledge or Learning Tree. Tailored training programmes for different roles is normally required, backed up by related media.
Tester Responsible for testing custom developed solutions on a Sandbox, Development/Staging environment. Authorise deployment to SharePoint Production system. IT or Business function – depending on who has defined the requirements.
Support Responsible for providing support to different roles, including help Desk support to end-users, floor-walking etc. Usually share knowledge in FAQ forums and feedback to Training/Governance process. Commonly work to agreed SLA’s to provide efficient response to requests or queries.


For smaller deployments one person may wear several “hats”, but it remains important that each individual understands their responsibilities and governance controls are in place to help protect SharePoint’s evolvement, in alignment with business needs.

A SharePoint Governance Board should also be appointed, with contributors from IT and the business – including senior stakeholders. The Governance Board should meet regularly to review how SharePoint is being used, address new requirements, and update standards, policies and procedures. It is recommended that the Board includes a rotating membership from the Business, so that an effective feedback loop can be incorporated into the governance process.

I usually define an organisation’s roles & responsibilities in a RACI Matrix and map particular activities or tasks to defined Governance Standards and Policies, using a SharePoint Governance Team Site I have developed over the years.

See Combined Knowledge’s SharePoint training programme here:

Re-instating the Navigate Up function on SharePoint 2013

For some reason SharePoint 2013 doesn’t include the Navigate Up function previously available to SharePoint 2010. This function is important when navigating up a site hierarchy. To get it back you must open SharePoint Designer 2013.

1. Click on Master Pages and create a copy of the seattle.master (the new default master page).

2. Right click on the seattle_copy(1).master and select Open. Search for:

class=”ms-breadcrumb-dropdownBox” – it should be on line 369.

3. Delete the style=”display:none;” at the end of the line.

4.Delete the Visible=”false” a couple of lines underneath.

5. Save the seattle_copy(1).master.

6. On the Master Pages list, right-click on the seattle_copy(1).master and select Set as Default Master Page.

7. Check that the seattle_copy(1).master is applied to the site collection as the default Site Master Page by clicking on Master Page (under Look and Feel) in Site Settings.

8. Refresh the sub-site to see the Navigate Up icon to the left of the global navigation menus.


Importing Profile Pictures from Active Directory to SharePoint 2010 or 2013

This link explains how to add profile pictures to Active Directory using PowerShell, and how you can import these pictures into user profiles in SharePoint 2010 or 2013:

You can get sample contoso user accounts and images from the Codeplex site here:

Common PowerShell commands

Here are some commonly used PowerShell commands:

1. Add-SPSolution “<file location\Name.wsp>”

e.g. Add-SPSolution “c:\customsolution.wsp”

2. Install-SPSolution -Identity <Name.wsp> -WebApplication http://name -GACDeployment

e.g. Install-SPSolution -Identity customsolution.wsp -WebApplication http://sp10/sites/finance -GACDeployment

3. Uninstall-SPSolution -Identity <Name.wsp> -WebApplication http://name

e.g. Uninstall-SPSolution -Identity customsolution.wsp -WebApplication http://sp13/sites/hr

4. Remove-SPSolution -Identity <Name.wsp>

e.g. Remove-SPSolution -Identity customsolution.wsp

How to change a site collection’s URL

1. Backup the site collection using PowerShell or the menu option available in Central Admin.

2. To restore, use PowerShell. Here is an example:

Restore-SPSite -Identity http://thehub.harrogate.local/bussupport/procurement -Path c:\backup\SharePoint\[BackupFileName.bak] -DatabaseServer [DatabaseServerName] -DatabaseName [ContentDatabaseName] -Force

How to create a new site collection assigned to a new content database

$db=New-spcontentdatabase –name “Marketing_ContentDB01” –webapplication http://sp10; new-spsite –url http://sp10/sites/marketing -name “Marketing Site” –description “Welcome to the Marketing Site” –owneralias “contoso\driscollm” –contentdatabase $db –template “STS#0”