Posts tagged with "Microsoft SharePoint"

SharePoint Workflows, Emails, and Groups

Posted within Administration on by Ryan Ball

Another note to self. When wanting a SharePoint workflow to send an email to the members of a specific SharePoint group:

  1. ensure that the group has at least Read access to the site
  2. within the group settings, check that “Who can view the membership of this group?” is set to Everyone

Migrating Lists from SharePoint 2010 to SharePoint 2013

Posted within Administration on by Ryan Ball

While waiting for a purchase order for Sharegate to be approved, I needed to quickly migrate content of an old SharePoint 2010 list to our new SharePoint 2013 farm. Out of the box this isn’t straight forward, and Microsoft recommend a complete backup, move and upgrade approach for the entire content database. Time-wise, this wasn’t an option and seemed overkill for a single list.

In the past I’ve experimented by writing a PowerShell script to export the list’s content to a .CSV file and it’s attachments into folders, and then another script to suck it back into the destination site.

Before heading down that route again, I searched for a different approach and found the Fast & Cheap method documented by Vlad Catrinescu.

It basically involves:

  1. Exporting the list from SharePoint 2010 via the Backup and Restore option within Central Administration.
  2. Changing the extension of the resulting files from .cmp to .cab, and extracting their contents.
  3. Amending the versions stated within the SystemData.xml file from 14.0.x.x to 15.0.x.x
  4. Repackaging them back into a .cab file via CapPack.
  5. Changing the extension from .cab back to .cmp
  6. Importing the list into SharePoint 2013 via PowerShell.
Import-SPWeb -Identity http://mysharepointsite -Path \\temp\SharePointList.cmp -IncludeUserSecurity -Verbose

It seems to have worked like a charm!

SharePoint 2013 and IE11 Support

Posted within Administration on by Cornflower Design

Very odd. Even though I’ve been using Internet Explorer 11 and SharePoint 2013 together for some time, this morning, when I created a new Site Collection and added a Calendar, it wasn’t rendering as it should and many links were broken.

After a little research,  it seems that IE11 doesn’t work out-of-the-box with SharePoint 2013 and boils down to an inconsistency with the X-UA-Compatible meta tag.

To overcome this, I added a new URL rewrite rule into IIS that spoofs the User Agent of the visitor’s browser, forcing the SharePoint page to be rendered correctly. No Compatibility View required.

Using the Content Query web part in SharePoint without activating the Publishing feature

Posted within Administration on by Cornflower Design

You can use the Content Query web part within a SharePoint site without activating publishing feature (which you may want to do as activating the feature introduces and changes a lot of options):

  1. Go to the Web Part Gallery within an existing publishing site
  2. Export the ContentQuery.webpart file and upload it to the Web Part Gallery of the destination site
  3. Copy the three .XSL documents (Header, ItemStyle, ContentQueryMain) from the XSL Style Sheets folder within the Style Library and transfer them to the destination site

SharePoint 2013 & PerformancePoint

Posted within Administration on by Ryan Ball

Note to self: Instead of banging your head for two days trying to resolve the issue of PerformancePoint reports not displaying. When you see a “Failed to Sql Query data XEvent collector on sqldbserver…” message within the log files, first ensure that the SharePoint farm account has been granted the serveradmin role upon the SQL server.

See: Failed to Sql Query data XEvent collector on sqldbserver. The error is Object reference not set to an instance of an object. And other SQL related errors in SharePoint 2013

SharePoint’s People Picker Error

Posted within Administration Development on by Ryan Ball

Since the roll out of Internet Explorer 10, our users were having trouble whenever they attempted to give someone access to their SharePoint 2010 area via the Grant Permissions dialog. Whenever they clicked the Browse icon, they’d receive a “An unexpected error has occurred” message.

One solution that seemed to solve this issue was to add the domain of the SharePoint site into the browser’s Compatibility View Settings – but that would effect all sites using the domain (including non-SharePoint sites).

While researching the issue I found a suggestion that it could be corrected by appending a META tag to one of the MasterPages.

Normally I wouldn’t dare edit one of the SharePoint core files, but as this was effecting so many users and we’ll be migrating to SharePoint 2013 in the near future, the benefits outweighed the risks.

  1. Browse to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS and locate the pickerdialog.master file.
  2. Immediately after the opening HEAD tag, insert the following line: <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ />

The changes appear to have resolved the issue completely.

Value does not fall within the expected range

Posted within Development on by Cornflower Design

The following code, which was supposed to update the “Current” Composed Look, was throwing a “value does not fall within the expected range” error each time I ran it.

SPWeb web = properties.Feature.Parent as SPWeb;
SPList gallery = web.GetCatalog(SPListTemplateType.DesignCatalog);

if (gallery != null)
{
    SPQuery q = new SPQuery();
    q.RowLimit = 1;
    q.Query = "<Where><Eq><FieldRef Name='DisplayOrder'/><Value Type='Number'>0</Value></Eq></Where>";
    q.ViewFields = "<FieldRef Name='DisplayOrder'/>";
    q.ViewFieldsOnly = true;

    SPListItemCollection items = gallery.GetItems(q);

    foreach (SPListItem item in items)
    {
        item["MasterPageUrl"] = web.MasterUrl;
        item.Update();
    }

}

After a lot of head scratching, it boiled down to the ViewFieldsOnly property which, which I had left set to true. Doh! Updating the property to false corrected the error.

See: SPQuery.ViewFieldsOnly property

The URL is not available, does not reference a SharePoint site, or you do not have permission to connect

Posted within Administration on by Cornflower Design

This is a handy thing to remember for an issue I just ran into. When you try to connect to a SharePoint URL from Dashboard Designer, you may see the following prompt:

“The URL is not available, does not reference a SharePoint site, or you do not have permission to connect”

To resolve the issue I had to ensure that the Service Account which was running PerformancePoint Services had been given owner-level access to the Content database.

SharePoint Content Type IDs

Posted within Administration on by Cornflower Design

This is a handy PowerShell snippet for returning a list of all Content Types and their IDs within a SharePoint site.

$site = Get-SPSite http://www.domain.com
$web = $site.RootWeb
ForEach( $contentType in $web.ContentTypes ) { Write-Host $contentType.Name": "$contentType.ID }

SharePoint 2013: Focus on Content

Posted within Development on by Cornflower Design

SharePoint 2013 has introduced a small Focus on Content icon to the ribbon bar which, for the MasterPages that support it, will show and hide portions of the page when clicked. This can be useful for hiding non-essential page elements.

When the icon is clicked, JavaScript will do two things:

  1. It creates a cookie, so the selection is remembered the next time the page is visited.
  2. It adds a new ms-fullscreenmode class to the page’s BODY tag.

So, via CSS, we can decide which elements of the page should be hidden via the Focus on Content functionality.

.ms-fullscreenmode #nonessentialcontent { display: none; }