SharePoint Correlation error: system.invalidoperationexception: namespace prefix ‘xsd’ is not defined. When using the person picker.

This is an interesting problem which only occurs when the people picker is being run in IE9 mode.  You may find older versions of IE work without issue and other browsers too.  A quick server side fix can be implemented by opening the pickerdialog master file and editing the header.  The file should be located here: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\pickerdialog.master

Simply add the following to the top of the file using your favorite text editor.

<head>
                <meta name=”GENERATOR” content=”Microsoft SharePoint” />
                <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ />

You should then perform an iisrest.  Either use the IIS graphical tools to do this or in an eleveted command window run IISRESET /noforce

As always take a copy of the master file before editing and if possible test this change in your dev/test environment first.  (You do have one right?)

This workbook cannot be opened because it is not stored in an Excel Services Application trusted location when using SSL in Sharepoint 2010

When attempting to view or edit and Excel workbook in the browser you get the following error:

Cannot open trusted location

Curiously this error doesn’t occur when opening the same file without using SSL over a HTTP which suggests it isn’t actually the location the file is stored in which isn’t trusted but in fact the URL used to access it.

To resolve the problem follow the following steps:

1. Open the central administration site and navigate to “Application settings” and then “Manage Service Applications”

service applications screenshot

2. Once the “manage Service Applications” page has loaded locate and click on “Excel Services Application”

ExcelServicesApplication

3. Click on “Trusted File Locations”

trustedfilelocations

4.  Click on “Add Trusted File Location” and type “https://” in the address field then tick the “Children trusted” box.  You may also wish the change the “Allow External Data” setting to “Trusted data connection libraries and embedded if required in your worksheets.

trustedlocationconfig

5. Click on OK and re-try opening your excel workbook.  The workbook should open correctly.

While the above settings are appropriate for most organisations you may wish to edit the default http:// path to reflect only your own access URLs instead of the whole http:// and https:// range.  If you do this just remember to revisit this should you add or change any alternate access mappings.

SharePoint management shell commands fail with access denied when using run-as

I often log on with a non privileged account and then execute individual applications or scripts as a privileged account using the “run as” feature found in windows.  Unfortunately it seems with the sharepoint management shell that this often fails with access denied.

 

error message

First double check you are sure the account your using is correct, is in the farm administrators group and has shell access (try Get-SPShellAdmin and if you don’t have it get a user who is a shell admin to add you with Add-SPShellAdmin with no database specified.)

I found that actually logging on as the privileged user worked around the error.  It is a shame as it means working interactively as an admin which always introduces a little bit of risk and I personally like the safety net of having to explicitly run something as admin if I want to make changes.

No error message

 

Notice the change in background colour and the window title when run directly instead of with the run as option.

Unable to add new SharePoint 2010 server to farm due to missing products and patches when service pack 1 media is used.

Recently I built a new SharePoint 2010 server and attempted to add it to an existing farm.  The original servers were all setup on the original pre-SP1 media and then updated organically while for the new server I opted to use the latest media for sharepoint and office web apps which comes with SP1.

The install went through fine with no errors however on attempting to join the farm I was prompted to install many products and patches.

Curiously the same update is listed twice for different build numbers and installing the update only satisfies one of the build numbers listed in the check.  In addition to this a number of language packs are all listed as missing locally with the build number 14.0.6029.1000 despite none of these actually being installed on the original existing servers.

The full list of items:

Microsoft SharePoint Server 2010 Installed Across Server Farm 

Microsoft SharePoint Foundation 2010 1033 Lang Pack

Update for Microsoft SharePoint Foundation 2010 (KB2553014) (14.0.6106.5000)
Missing on xxxx
Missing Locally
Update for Microsoft SharePoint Foundation 2010 (KB2553014) (14.0.6109.5000)
Missing on xxxx
Missing on xxxx
Microsoft SharePoint Portal

Security Update for Microsoft SharePoint Server 2010 (KB2494022) (14.0.6106.5001)
Missing on xxxx
Microsoft Shared Components

Security Update for Microsoft SharePoint Server 2010 (KB2560885) (14.0.6106.5001)
Missing on xxxx
Missing on xxxx
Microsoft Word Server

Update for Microsoft Sharepoint Server 2010 (KB2553132) 64-Bit Edition (14.0.6108.5000)
Missing on xxxx
Missing on xxxx
PerformancePoint Services for SharePoint

Security Update for Microsoft SharePoint Server 2010 (KB2566456) (14.0.6106.5001)
Missing on xxxx
Missing on xxxx
PerformancePoint Services in SharePoint 1033 Language Pack

Security Update for Microsoft SharePoint Server 2010 (KB2566958) (14.0.6106.5001)
Missing on xxxx
Missing on xxxx
Microsoft Document Lifecycle Components

Security Update for Microsoft SharePoint Server 2010 (KB2566954) (14.0.6106.5001)
Missing on xxxx
Missing on xxxx
Microsoft Office Server Proof (Arabic) 2010

Microsoft Office Server Proof (Arabic) 2010 (14.0.6029.1000)
Missing Locally
Microsoft SharePoint 2010 Service Pack 1 (SP1) (14.0.6029.1000)
Missing Locally
Microsoft Office Server Proof (German) 2010

Microsoft Office Server Proof (German) 2010 (14.0.6029.1000)
Missing Locally
Microsoft SharePoint 2010 Service Pack 1 (SP1) (14.0.6029.1000)
Missing Locally
Microsoft Office Server Proof (French) 2010

Microsoft Office Server Proof (French) 2010 (14.0.6029.1000)
Missing Locally
Microsoft SharePoint 2010 Service Pack 1 (SP1) (14.0.6029.1000)
Missing Locally
Microsoft Office Server Proof (Russian) 2010

Microsoft Office Server Proof (Russian) 2010 (14.0.6029.1000)
Missing Locally
Microsoft SharePoint 2010 Service Pack 1 (SP1) (14.0.6029.1000)
Missing Locally
Microsoft Office Server Proof (Spanish) 2010

Microsoft Office Server Proof (Spanish) 2010 (14.0.6029.1000)
Missing Locally
Microsoft SharePoint 2010 Service Pack 1 (SP1) (14.0.6029.1000)
Missing Locally
Microsoft® Office Web Apps Missing Locally

All in all it looks to me like the slipstreamed sp1 media contains a number of old/broken files.

I ended up completely removing both SharePoint 2010 and office web apps from the new server and then installing the products again from the original pre-sp1 media and then updating to sp1 manually.  This had the desired effect and the odd missing updates for unexpected build numbers and missing language packs were all gone and the new server joined the farm as it should without issue.

 

Customizing the ItemStyle.XML to style content queries

On a sharepoint installation I am working on the main homepage is built from a number of content queries which are all configured to use a blog site in the same site collection.  The functionality out of the box is great in terms of filtering which posts appear but a little less so in terms of what the links look like.  To my dismay it appears that the content query web parts completely ignore any CSS overrides and do thier own thing.  In order to style them I found myself editing the itemstyle.xml file which can be found at the root of the site under “Style Library>XSL Style Sheets>ItemStyle.XML”

It is possible to simply edit one of the existing xsl templates within the file however I prefered to copy and paste an existing style template, change its name and then adjust it until I achived the style I wanted.  The benefit of doing it this way is that the existing styles are all preserved.  To use the new style simply select it in the content query web part.  I have attached the additional text I added to the file which creates a new style called “BlogPostBlack”

Make sure to publish a new major version when you are done and if version control is not enabled take a backup of the file before you change it.

 

<xsl:template name=”BlogPostBlack” match=”Row[@Style=’BlogPostBlack’]” mode=”itemstyle”>

        <xsl:variable name=”SafeLinkUrl”>

            <xsl:call-template name=”OuterTemplate.GetSafeLink”>

                <xsl:with-param name=”UrlColumnName” select=”‘LinkUrl’”/>

            </xsl:call-template>

        </xsl:variable>

        <xsl:variable name=”DisplayTitle”>

            <xsl:call-template name=”OuterTemplate.GetTitle”>

                <xsl:with-param name=”Title” select=”@Title”/>

                <xsl:with-param name=”UrlColumnName” select=”‘LinkUrl’”/>

            </xsl:call-template>

        </xsl:variable>

        <div class=”custom_posttitle”>

            <xsl:call-template name=”OuterTemplate.CallPresenceStatusIconTemplate”/>

            <font size=”3?><a style=”font-weight:bold;color:#3B2A31? href=”{$SafeLinkUrl}” title=”{@LinkToolTip}” onClick=”document.getElementById(‘divIDName’).style.color=’#907673?”>

              <xsl:if test=”$ItemsHaveStreams = ‘True’”>

                <xsl:attribute name=”onclick”>

                  <xsl:value-of select=”@OnClickForWebRendering”/>

                </xsl:attribute>

              </xsl:if>

              <xsl:if test=”$ItemsHaveStreams != ‘True’ and @OpenInNewWindow = ‘True’”>

                <xsl:attribute name=”onclick”>

                  <xsl:value-of disable-output-escaping=”yes” select=”$OnClickTargetAttribute”/>

                </xsl:attribute>

              </xsl:if>

              <xsl:value-of select=”$DisplayTitle”/>

            </a>

            </font>

        </div>

                <xsl:variable name=”StartDate”>

                                <xsl:value-of select=”ddwrt:FormatDateTime(string(@PublishedDate), 1033, ‘g’)” />

                </xsl:variable>

                <div class=”custom_date”>

                                <xsl:value-of select=”$StartDate” />

                </div>

                <div class=”custom_description”>

                                <xsl:value-of select=”@Body” disable-output-escaping=”yes” />

                </div>

  </xsl:template>

Sharepoint blog comment text colour css

In my efforts to brand a SharePoint installation with a number of unusual colours I found my self struggling with the comments text on the blog pages. Comments were always being displayed in a light grey which was hard to read against a slightly off white background. To make things worse when a user is creating a comment they have no control over font/colour.  I ended up using the following CSS to force the comments to be displayed in a much darker colour.

H3.ms-CommentHeader {
POSITION: relative; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; COLOR: #1e1e1e; FONT-SIZE: 1.6em; RIGHT: auto; FONT-WEIGHT: normal; PADDING-TOP: 0px; TOP: -0.25em; LEFT: -2px
}
H4.ms-CommentTitle {
PADDING-BOTTOM: 0px; LINE-HEIGHT: 1.7em; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; COLOR: #1e1e1e; FONT-SIZE: 8pt; PADDING-TOP: 0px
}
.ms-CommentBody {
PADDING-BOTTOM: 12px; LINE-HEIGHT: 1.7em; WIDTH: 775px; COLOR: #1e1e1e; FONT-SIZE: 8pt; PADDING-TOP: 6px