Export a Term Set to CSV with Identifiers in PowerShell

I recently had a need to export all of the terms from a given term set in a SharePoint 2010 Managed Metadata Service application to CSV for consumption in another process. The following PowerShell script will create a .csv file with all of the term names and identifiers for the supplied Term Store/Term Store Group/Term Set.

Updated: There was an error in the previous version of this script. It did not account for the fact that the ampersand character (“&”) is stored as a fullwidth ampersand (“\uFF06”) when a term is created. The script has been adjusted to replace any fullwidth ampersands with a basic Latin ampersand in the output.

The Script

SharePoint Governance Resources

Governance is something that should be at the top of the list for any SharePoint implementation (no matter how small). The following are some checklists/whitepapers/etc. provided by Microsoft that can get you started.

This is of course only sampling of what’s available. Feel free to sound off in the comments with your go-to resources for SharePoint governance.

This one is a little old, but still relevant. If you’ve ever struggled with trying to convey what SharePoint is to your users, refer them to this video.

InfoPath 2007 Contact Selector - Require a selection

Updated: Click here for an example of how to achieve the same functionality without any code.

The following solution will require a Full Trust form with code, but will allow for a Contact Selector to be placed on a browser-based InfoPath form which will consistently validate, requiring the selection of a user as well as allowing for only one selection.

The code:


public void supervisorEmployeeID_Changed(object sender, XmlEventArgs e)
{
     try
     {
          int supervisorCount = e.Site.SelectChildren(XPathNodeType.Element).Count;

          if (this.Errors.GetErrors("_supervisorCountError").Length > 0)
               this.Errors.Delete("_supervisorCountError");

          if (supervisorCount > 1)
               this.Errors.Add(e.Site, "_supervisorCountError", "You can only select one Manager");
          else if (supervisorCount < 1)
               this.Errors.Add(e.Site, "_supervisorCountError", "You must select a Manager");
     }
     catch { }
}


The above is meant to serve as a reference and should be self-explanatory.

A Manager’s Guide to SharePoint

The Acuff Group recently posted a whitepaper titled A Manager’s Guide to SharePoint [PDF] which makes for an interesting afternoon read.

SharePoint Designer - The Cat Is Out of the Bag

Today marks the official release of SharePoint Designer as a free product offering from Microsoft.  While overall, this announcement can certainly be considered a good thing by the SharePoint community (who doesn’t like free stuff?), as a SharePoint “administrator” it makes me cringe. It is a good thing all of us have “locked downSharePoint Designer in our respective environments.

You did remember to lock down, didn’t you?

[Download]

MSDN Magazine: 10 Best Practices For Building SharePoint Solutions

MSDN Magazine has a SharePoint focused article this month titled 10 Best Practices For Building SharePoint Solutions. If you’re trying to wrap your head around the scope and depth of developing solutions on top of SharePoint, the article makes for a good primer.

InfoPath Custom Initiation Form “stuck” on “Installing”

When developing custom InfoPath initiation forms for my workflows, I sometimes forget a crucial step when publishing the forms. If you enter an alternate location when publishing your form, the form state will become stuck on “Installing”.

The moral of the story? When publishing a custom initiation form, be sure to leave the “Alternate” publishing location empty.

Tools for your SharePoint Toolbox: SPTraceView

SPTraceView (by Hristo Pavlov) is a tool which allows a user (with console and/or RDP access to a SharePoint server) to view the trace logs for SharePoint in real time. Parsing through ULS logs can be a tedious process, but being able to see the events as they occur certainly makes it much more palatable.

SPTraceView can be used in either a single server or a farm scenario, although a farm does require some configuration.

Fixing Absolute URLs in a Content Editor Web Part

Maxime Bombardier has a post on the subject of fixing one of the bigger issues with the Content Editor web part. For the uninitiated, a Content Editor web part always renders absolute URLs when the rich-text editing capabilities are used. I must admit that I would have never have thought to use a control adapter to manipulate the output of the web part on the fly. Now that I have learned something new, you should too.

Go check it out.