Sign In

Christopher Scolt


Aug 29
Perth SharePoint User Group Presentation Review

I've finally done my first​ public presentation as a professional; and I'll have to admit the nerves didn't hit until I was in Microsoft's seminar room.   Counting heads wasn't the first thing on my mind but on review I think there were around 50 people in attendance which I'm certainly happy about given this was my first shot on the stage.

We fielded a few questions at the end of the presentation, of which I'm going to attempt to cover in this article.  I've also uploaded the slide deck and photos taken.

What level of support does Microsoft offer for SharePoint 2013 Search and HP Trim?

Let me start of my admitting that my knowledge of TRIM is not the greatest.  My understanding is that the EDRMS has enabled integration of full SharePoint 2007 and 2010 sites, providing document and records management for the content living in SharePoint. At the time of writing, I'm not aware of any index connectors that are available for TRIM, however SharePoint 2013 allows for custom index connectors to be built using the BCS model.  Theoretically, any functionality that can be exposed from TRIM via web services and the like can be consumed in SharePoint 2013.

A client considering upgrading from SharePoint 2007 has options between a SharePoint 2010 farm, a SharePoint 2013 farm and a hybrid model (like that presented).  What would be the most sensible goal?

This question certainly depends on several factors, a series of articles might be enough to cover everything here.  Essentially it does come down to the culture of the business and what they are trying to achieve.  In my own opinion, the effort required to upgrade from SharePoint 2007, directly to SharePoint 2013 would be won back in the long run (assuming the client later wants to eventually upgrade to SharePoint 2013).

Is there any documentation (online or otherwise) that describes the approaches presented?

There is, but you'll have to search the corners of the web to find it.  If you're planning on migrating from FAST Search Server for SharePoint 2010, then you're in luck as TechNet has you covered.  However, if you're migrating from SharePoint 2010 Enterprise Search, it will take a bit more research.  That being said, I'll endevour to cover this over the next couple weeks in my own blog (so keep posted)!

Aug 22
I'm presenting at the Perth SharePoint User Group

​I'll have the pleasure of presenting along with Brian Carter at the SharePoint User Group in Perth next week.  We will be introducing us to the concept of a Search First Migration which leverages Search as a driver for adopting SharePoint 2013.

Find out more and register here.

Aug 20
SharePoint Online Lessons - DateTime.Now

I've been fortunate enough to gain a fair bit of experience with Office 365, not just through my own blog, but during my 9 to 5 as well.  Needless to say, working with SharePoint Online is worlds away from the familiarity of an on-premise environment.

Vigilant developers will always check timezones when they are working with dates, however for the developers that are...much like myself, this isn't usually the case.  So when you're working with SharePoint Online, if you obtain a date value from a SharePoint list item (for example), then the timezone for that value will correspond to the regional settings for the site that the data resides in.  No big deal there.

However, if you are obtaining data from different sites with different timezones, or (more commonly) working with a system time such as System.DateTime.Now(), then there's no guarantee that you're looking at dates within the same timezone.  BOOM! The code you're used to seeing working flawlessly has died as soon as its provisioned online.

The first lesson is to avoid calling DateTime.Now when working with Office 365.  Here a few helper methods that ensure a DateTime object is using the timezone of the SPWeb you are using.

public static DateTime Now(this SPWeb web)

        {

            return web.LocalTime(DateTime.Now);

        }

 

public static DateTime LocalTime(this SPWeb web, DateTime dateTime)

        {

            return web.RegionalSettings.TimeZone.LocalTimeToUTC(dateTime.ToUniversalTime());

        }

 

Update (26th August 2013) :

Make sure that you don't use this LocalTime method for DateTime values obtained from SharePoint data.  In my findings, the Kind property for SharePoint dates is "Unspcified".  When calling dateTime.ToUniversalTime(), the DateTime value will be treaded as having the same time zone as a system date.

Jun 07
A new direction

Or rather,  an old direction revisited.

Despite maintining my own domain, and a blog for nearly four years, i haven't paid much attention to it.  In those four years, I've learned many things.  Even these days, there's plenty of things I learn that can't be discovered with a quick search on the internet.  In truth, I haven't shared my learnings with the SharePoint community as much as I would have liked to.

To be honest, I think I reskinned my old wordpress site more frequently than I updated content.  So infrequently did I visit the administration pages, I was often lost trying to perform the simple tasks.

So to begin with, I'm making a small change.  I'm moving to SharePoint online.  There's some good reasons for this:

  • Firstly, the tooling available is going to be familiar.  Obviuos as it may be, this does play a big part.
  • In some regard, I'll be practicing what I preach.  Maintaining my own SharePoint site will be putting myself on the other side of the fence.
  • Next, I want to get a firm grasp of the cloud (no pun intended).  Having worked primarily with on-premise environments, I intend to push SharePoint Online to the limit in order to develop my own understanding.  Not being so much of a designer, I'm going to apoligize here for how this site may look from time to time.  In some regards, this will be my sandbox.  Apology over - you won't hear about this from me again.
  • Finally, I'm finding myself more and more of a Microsoft fanboy.  Already loving Windows 8, Windows Phone and the XBox, and working everyday with SharePoint, it almost seemed logical to make the transition.

I've set a goal to share my experiences with the communitiy and keep this site from getting stale.  Hopefully soon I'll write about my experience migration to SharePoint Online.  For the time being, the technical audience will find my articles more interesting, however time will tell if that changes.

So there it is, out with the old and all that...

Jun 19
SharePoint Designer Workflows–Lessons Learned

I recently built a workflow in SPD and came across a few unexpected issues during the build process.

I found that normally I was able to Save and Publish the workflow to begin with, but then came found that new instances of the workflow would run under an older version of the workflow.  It seems that SPD occasionally sends a cached version of the workflow back to the SharePoint server – this article from Gabe Hall explains how to clear the SPD cache and upload the workflow successfully:

http://blogs.msdn.com/b/sharepointdesigner/archive/2007/03/27/tip-clearing-the-spd-workflow-assembly-cache.aspx

Commonly, users like to receiver email notifications from these types of workflows.  At a first glance, the ability to inject HTML into SharePoint Designer workflows has been removed (which was possible with SPD 2007).  I suspect this is due to the work the Microsoft team has put into the rich text editor in SPD2010 for email support.  The rich text support is limited however, and if you do need to crack open the HTML, you only need to open up the advanced properties for the email activity (select the email activity in the workflow and click “Advanced Properties” in the ribbon), then simply edit value of the Body property.

One last note, I found that even though I was editing what seemed to be “pure” html in the Advanced Properties, SharePoint designer still treated line breaks as a <br/>, so you actually need to write the html body of the email on one line!

Feb 28
Provisioning Managed Metadata fields

I’m finding that the concept of Enterprise Keywords is really taking of in SharePoint 2010 via its Managed Metadata Service. The Managed Metadata Service Application in SharePoint 2010 provides a fast and slick UI for end users that need to meet businesses’ stringent taxonomy requirements as well as a platform for social collaboration via tags.

There are a few hazards that come along with using Managed Metadata, particularly when it comes to writing solutions that leverage the service. Hopefully, I’ll get to cover of a few of these in the coming weeks.

Provisioning Managed Metadata fields in a SharePoint 2010 solution isn’t a walk in the park, fortunately Ari Bakker has done an extremely good job of documenting how to do this. http://www.sharepointconfig.com/2011/03/the-complete-guide-to-provisioning-sharepoint-2010-managed-metadata-fields/

Happy Coding

Feb 28
Removing Duplicated Field Links from Content Types

I wasn’t sure what to title this article; or how to appropriately tag it for that matter; being such a perculiar scenario. So apologies first up if reading this article turns out to be a complete waste of time. :) I came accross an interesting scenario on a client’s SharePoint site and don’t think its something that will pop up too often (all the more reason to record my findings!)

I found that some fields appeared more than once on the New and Edit forms on a particular list. At first I thought that two instances of the same data entry web part were loaded on the respective forms; but only some fields were repeated and surely enough this wasn’t the case.

Jumping into the list’s settings; I found that there was no duplication of fields (columns) , however the content types in the list did seem to reference particular fields more than once.

Now I don’t understand how this came about (nor do I think I ever will). But once the cause of the issue was identified, the fix was fairly easy. The relationship between SPFields and SPContentTypes is the SPFieldLink object. Here’s a snippet I’ve used to clean up the field duplication:

if (list.ContentTypesEnabled)
{
  foreach (SPContentType contentType in list.ContentTypes)
  {
    try
    {
      if (contentType.Sealed || contentType.ReadOnly)
        continue;

      // Identify the duplicate Field Links
      var fieldLinksToKeep = new Collection();
      var fieldLinksToRemove = new Collection();
      foreach (SPFieldLink fieldLink in contentType.FieldLinks)
      {
        if (fieldLinksToKeep.Contains(fieldLink.Name))
          fieldLinksToRemove.Add(fieldLink.Id);
        else
          fieldLinksToKeep.Add(fieldLink.Name);
      }

      // Remove the duplicates
      foreach (Guid fieldLinkId in fieldLinksToRemove)
        contentType.FieldLinks.Delete(fieldLinkId);
      
      contentType.Update();
    }
    catch (Exception exception)
    {
      LogMessage("Unable to change fieldLinks for " + contentType.Name);
      LogMessage(exception.ToString());
    }
  }
}
Dec 23
Choosing a storage medium for configuration items

After passing Microsoft’s exam 70-576 – PRO: Designing and Developing Microsoft SharePoint 2010 Application,  I’ve had a real desire to utilize the knowledge learned across my day to day work.  One of the common questions I used to keep asking myself was “Where is the best place to store my configuration values?”

Of course, after being through the exam material over and over again, the answer is simple.  “It Depends!”

One of the exam objectives in the Managing Application Development section is around defining an application configuration approach. (http://www.microsoft.com/learning/en/us/exam.aspx?id=70-576#tab2)  “This objective may include … defining “web.config” modifications, Lists as a configuration option, Property Bags, declarative vs. programmatic, SP persisted objects.

So you are probably reading this with the following burning question:

Where is the best place to store the URL for a master list? or
Where should i store a SQL connection string? or even (but hopefully not)
Where can I store this password?

There’s no one size fits all approach with this, so what I have done is listed some of the more common options, and some (hopefully) helpful information about each.

  • web.config File
    The web.config file is a popular choice for configuration items, particularly for .NET developers who are starting to ply their trade in SharePoint.  Its important to note that SharePoint stores a web.config file for each Web Application (in the [DRIVE]:\inetpub\wss\VirtualDirectories\[WebApplication]\ folder by default).  Making a change to the web.config file also (automatically) recycles the associated web application, causing an outage to every site collection hosted on that web application.
    Because the web.config file is a physical file on the SharePoint server itself, only an Administrator would be able to make modifications that are required.  This is also very relevant when the web application is hosted on multiple servers in a load balanced (or similar) scenario, changes made to one web.config file will only affect processes on that particular server node.
    I’ve had some tough times in the past trying to debug issues related to incorrectly formatted web.config files causing an entire web application to be unavailable.  Perhaps it could be a reflection of my ability to work with XML documents, but it’s certainly not an option if end-users need to be able to make updates.
  • Property Bags
    When coding with the SharePoint 2010 object model, you’ll find the “Properties” property bag on many classes such as SPSite, SPWeb and more. The property bag is simply a StringDictionary that’s persisted on those objects.  What’s important to note is that the property bag doesn’t have any granular security available, but you can manage this by being selective about the scope you choose.  You’ll also need to make you keys unique to avoid conflicts with other applications using the same property bag.
    You can also go ahead and make a UI for interacting with the Property Bag if you have requirements around users updating the configuration items.  I haven’t used it myself, but you may find this codeplex project is a good start:  http://pbs.codeplex.com/
  • SharePoint Persisted Objects
    The SPPersistedObject goes one step further than the Properties Bag and allows you to store objects against the SPFarm object, rather than just strings.  You can get a persisted object by using the GetObject method on an SPFarm object, or the GetChild method of the SPPersistedObject class  The following MSDN article might be of useful reference: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.sppersistedobject.aspx
  • SharePoint Lists
    The most user-friendly option, and that is important if your end-users need to able to make updates.  You’ve got an option here that won’t need a lot of additional development (if any).  If you have a set of business rules around the allowable configuration values, you’ve also got a lot of Out Of the Box friendliness right at your fingertips (think field types, list validation, security, etc.).

Hopefully after reading this, you can now make an informed design decision on configuration item storage.

Dec 14
70-576

I was fortunate enough to find some time in the last few weeks to prepare for Microsoft’s PRO Developer Exam for SP2010. Thanks to Matt Menezes who searched high and low through the web to dig up some great study material.  (See his article: http://spmatt.wordpress.com/2011/12/08/how-i-passed-70-576/)

I’m very happy to announce that I passed the exam on my first go early this week!

Feb 18
Reverting C2WTS to run as Local System

I’ve done a lot of work recently debugging Kerberos issues with SharePoint 2010.  If you find yourself in the same boat, do yourself a favour and read The SharePoint 2010 Kerberos Guide.

One thing I’ve had to do on several occasions, is change the account that the Claims to Windows Token Service runs as from a domain account back to the Local System account.  You may have noticed that once you’ve used Central Admin to change this from Local System to your service account, there’s no means to change this back.

 There seems to be little information out there on how to do this.  Luckily, I finally came across an update from Andras Gaas that explains how to do it on a single server environment.  If you have multiple servers in your farm, you may have more than one instance of the C2WTS running – in which case, you will need to modify the PowerShell command slightly:

 $claims = Get-SPServiceInstance | where {$_.TypeName -eq “Claims to Windows Token Service”}
$claims[0].Service.ProcessIdentity.CurrentIdentityType = 0
$claims[0].Service.ProcessIdentity.Update()
$claims[1].Service.ProcessIdentity.CurrentIdentityType = 0
$claims[1].Service.ProcessIdentity.Update()
$claims[2].Service.ProcessIdentity.CurrentIdentityType = 0
$claims[2].Service.ProcessIdentity.Update()

Don’t forget: you will need to restart the Claims To Windows Token Service (in Central Admin > Services on Server or otherwise) on each server.

1 - 10Next