<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The SharePoint Swiss Army Knife</title>
	
	<link>http://blog.henryong.com</link>
	<description>Stories from a SharePoint Engineer that isn't afraid of Visual Studio.</description>
	<lastBuildDate>Wed, 23 May 2012 04:40:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain="blog.henryong.com" port="80" path="/?rsscloud=notify" registerProcedure="" protocol="http-post" />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The SharePoint Swiss Army Knife</title>
		<link>http://blog.henryong.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.henryong.com/osd.xml" title="The SharePoint Swiss Army Knife" />
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheArtOfEvolution" /><feedburner:info uri="theartofevolution" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://blog.henryong.com/?pushpress=hub" /><geo:lat>33.695576</geo:lat><geo:long>-117.805881</geo:long><item>
		<title>Presentation: SharePoint 2010 Managed Metadata vs. SQL 2012 Master Data Services</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/m2VIMclChz4/</link>
		<comments>http://blog.henryong.com/2012/05/17/presentation-sharepoint-2010-managed-metadata-vs-sql-2012-master-data-services/#comments</comments>
		<pubDate>Thu, 17 May 2012 18:55:25 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[Managed Metadata Service]]></category>
		<category><![CDATA[Master Data Services]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=715</guid>
		<description><![CDATA[Posting of a presentation I did for the local SharePoint Users&#8217; Group (Orange County, CA) on May 16, 2012. This presentation was a comparison of two technologies that could be used as enterprise taxonomy stores. SharePoint 2010 Managed Metadata vs SQL 2012 Master Data Services<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=715&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Posting of a presentation I did for the local SharePoint Users&#8217; Group (Orange County, CA) on May 16, 2012. This presentation was a comparison of two technologies that could be used as enterprise taxonomy stores.</p>
<div id="__ss_12974080" style="width:425px;">
<p><strong><a title="SharePoint 2010 Managed Metadata vs SQL 2012 Master Data Services" href="http://www.slideshare.net/wolvie3421/sharepoint-2010-managed-metadata-vs-sql-2012-master-data-services" target="_blank">SharePoint 2010 Managed Metadata vs SQL 2012 Master Data Services</a></strong> <iframe src='http://www.slideshare.net/slideshow/embed_code/12974080' width='425' height='348' scrolling='no'></iframe></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/715/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/715/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/715/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=715&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/m2VIMclChz4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2012/05/17/presentation-sharepoint-2010-managed-metadata-vs-sql-2012-master-data-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2012/05/17/presentation-sharepoint-2010-managed-metadata-vs-sql-2012-master-data-services/</feedburner:origLink></item>
		<item>
		<title>What’s Faster? Querying a SharePoint List or Querying the Managed Metadata Service?</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/P7kznAf8Prc/</link>
		<comments>http://blog.henryong.com/2012/04/27/whats-faster-querying-a-sharepoint-list-or-querying-the-managed-metadata-service/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 22:07:26 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[CAML]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[List Queries]]></category>
		<category><![CDATA[Managed Metadata Service]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=689</guid>
		<description><![CDATA[Scenario What the doohickey am I talking about? Well, if you&#8217;re a SharePoint Developer that is tasked with using SharePoint to house referential metadata, you used to have 1 option. Prior to SharePoint Server 2010, SharePoint Lists were typically used to store this information. By using Lists as the datastore for referential information, we were able to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=689&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Scenario</h2>
<p>What the doohickey am I talking about? Well, if you&#8217;re a SharePoint Developer that is tasked with using SharePoint to house referential metadata, you used to have 1 option. Prior to SharePoint Server 2010, SharePoint Lists were typically used to store this information. By using Lists as the datastore for referential information, we were able to easily provide end users with the ability to manage this information without having to spend any time creating a UI for them. This also enabled the end users to create and manage values which could then be consumed by various applications whether it be basic SharePoint List Forms via Lookup columns, InfoPath forms or custom Web Parts and ASP.NET forms.</p>
<p>SharePoint Server 2010 takes this concept to the next level by introducing the Managed Metadata Service that enables users ranging from Site Administrators to Enterprise Information Architects the ability to manage this information at an enterprise level. However, this blog post will not be used to delve into the features of the Managed Metadata Service. To learn more about the features of Managed Metadata Service and why you would want to use a metadata and taxonomy store in the first place, please see <a href="http://office.microsoft.com/en-us/sharepoint-online-enterprise-help/introduction-to-managed-metadata-HA101974326.aspx">here</a>. In this blog post, I will be discussing query performance between the two options (SharePoint Lists vs. Managed Metadata Service Term Stores).</p>
<h2>Testing</h2>
<p>So how did I run these tests&#8230; First I set out to create a simple Windows Form application as my testing vehicle. In this application, I have a variety of fields and buttons that let me toggle back and forth between querying a specific SharePoint list for values via CAML and being able to query the MMS Term Store for specific terms.</p>
<p><a href="http://henryong.files.wordpress.com/2012/04/queryperftesttool.png"><img class="size-full wp-image-690 aligncenter" title="queryperftesttool" src="http://henryong.files.wordpress.com/2012/04/queryperftesttool.png?w=575&h=402" alt="" width="575" height="402" /></a></p>
<p>Here&#8217;s some sample code that I used to access the goodies:</p>
<h3><strong>List CAML Query</strong></h3>
<pre>string queryString = "&lt;Where&gt;&lt;And&gt;&lt;Eq&gt;&lt;FieldRef Name=\"Platforms\" /&gt;&lt;Value Type=\"LookupMulti\"&gt;" + 
InputTerm.Text + "&lt;/Value&gt;&lt;/Eq&gt;&lt;Eq&gt;&lt;FieldRef Name=\"Status\" /&gt;&lt;Value Type=\"Choice\"&gt;Active&lt;/Value&gt;&lt;/Eq&gt;&lt;/And&gt;&lt;/Where&gt;&lt;/Query&gt;";
bool found = false;
using (SPSite site = new SPSite("https://sharepoint/")) 
{  
   using (SPWeb web = site.OpenWeb())         
   {          
      SPList productsList = web.Lists["Products"];                 
      SPQuery query = new SPQuery();                 
      query.Query = queryString;                 
      SPListItemCollection products = productsList.GetItems(query);
      if (products.Count &gt; 0)                 
      {
         found = true;
      }
      foreach (SPListItem product in products)
      {
         Results.Text += product["Title"].ToString() + "\n";
         Results.Text += found.ToString() + "\n";         
      }
   }
}</pre>
<h3></h3>
<h3><strong>MMS Query  </strong></h3>
<pre>using (SPSite site = new SPSite(siteURL))
{
   TaxonomySession session = new TaxonomySession(site);
   TermCollection terms = session.GetTerms(InputTerm.Text, true);
   foreach (Term term in terms)
   {
      Results.Text += term.Name + "\n";
      if (term.Terms.Count &gt; 0)
      {
         found = true;
         foreach(Term childTerm in term.Terms)
         {
            Results.Text += childTerm.Name + "\n";
         }
      }
   }
}</pre>
<p>As a side note, looking at the sample code above, we can see that it is much easier to query for a Term from a MMS Term Store when compared to querying a SPList via CAML because, simply, there&#8217;s no CAML involved! You may have also noticed that there&#8217;s no need to access the SPWeb objects, so that saves us some memory as well.</p>
<p>The results of these tests were performed against two datasets of relative size. In the first round of testing, I had an SPList with about 40 List Items up against a Term Store with also about 40 Terms. The result set size was configured for 10 each. In the 2nd round of testing, I had increased the number of objects in each container to almost 500 each with a result set size of 100.</p>
<h2>Test Results</h2>
<p><strong>Small Query Sets</strong><br />
Query Objects =&lt; 40<br />
Result Set Size = 10</p>
<p><a href="http://henryong.files.wordpress.com/2012/04/smallquerytime1.png"><img class="alignnone size-full wp-image-709" title="smallQueryTime" src="http://henryong.files.wordpress.com/2012/04/smallquerytime1.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/smallsecquerytime1.png"><img class="alignnone size-full wp-image-708" title="smallSecQueryTime" src="http://henryong.files.wordpress.com/2012/04/smallsecquerytime1.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/smallphysmem1.png"><img class="alignnone size-full wp-image-707" title="smallPhysMem" src="http://henryong.files.wordpress.com/2012/04/smallphysmem1.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/smallmemutil1.png"><img class="alignnone size-full wp-image-706" title="smallMemUtil" src="http://henryong.files.wordpress.com/2012/04/smallmemutil1.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/smallcputime1.png"><img class="alignnone size-full wp-image-705" title="smallCPUTime" src="http://henryong.files.wordpress.com/2012/04/smallcputime1.png?w=575" alt=""   /></a></p>
<p><strong>Medium Query Sets</strong><br />
Query Objects =&lt; 500<br />
Result Set Size = 100</p>
<p><a href="http://henryong.files.wordpress.com/2012/04/medquerytime.png"><img class="alignnone size-full wp-image-704" title="medQueryTime" src="http://henryong.files.wordpress.com/2012/04/medquerytime.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/medsecquerytime.png"><img class="alignnone size-full wp-image-703" title="medSecQueryTime" src="http://henryong.files.wordpress.com/2012/04/medsecquerytime.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/medphysmem.png"><img class="alignnone size-full wp-image-701" title="medPhysMem" src="http://henryong.files.wordpress.com/2012/04/medphysmem.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/medmemutil.png"><img class="alignnone size-full wp-image-702" title="medMemUtil" src="http://henryong.files.wordpress.com/2012/04/medmemutil.png?w=575" alt=""   /></a></p>
<p><a href="http://henryong.files.wordpress.com/2012/04/medcputime.png"><img class="alignnone size-full wp-image-700" title="medCPUTime" src="http://henryong.files.wordpress.com/2012/04/medcputime.png?w=575" alt=""   /></a></p>
<h2>Summary</h2>
<p>As you can see from the test results above, retrieving metadata via the MMS is faster, uses less memory and the code is simpler in comparison to performing CAML lookups on lists. Query times against the MMS seem to be stable/unchanged when the datasets are increased from 40 to almost 500 objects. The CAML query times against lists with similar number of objects were roughly doubled or more on result sets of 100. So CAML query times increased as the list size increased vs. MMS query times did not increase with an increase in the number of terms in the term store. What do you think? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/689/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=689&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/P7kznAf8Prc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2012/04/27/whats-faster-querying-a-sharepoint-list-or-querying-the-managed-metadata-service/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/queryperftesttool.png" medium="image">
			<media:title type="html">queryperftesttool</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/smallquerytime1.png" medium="image">
			<media:title type="html">smallQueryTime</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/smallsecquerytime1.png" medium="image">
			<media:title type="html">smallSecQueryTime</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/smallphysmem1.png" medium="image">
			<media:title type="html">smallPhysMem</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/smallmemutil1.png" medium="image">
			<media:title type="html">smallMemUtil</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/smallcputime1.png" medium="image">
			<media:title type="html">smallCPUTime</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/medquerytime.png" medium="image">
			<media:title type="html">medQueryTime</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/medsecquerytime.png" medium="image">
			<media:title type="html">medSecQueryTime</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/medphysmem.png" medium="image">
			<media:title type="html">medPhysMem</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/medmemutil.png" medium="image">
			<media:title type="html">medMemUtil</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/04/medcputime.png" medium="image">
			<media:title type="html">medCPUTime</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2012/04/27/whats-faster-querying-a-sharepoint-list-or-querying-the-managed-metadata-service/</feedburner:origLink></item>
		<item>
		<title>SPSLA Presentation: Managed Metadata and Taxonomies in SharePoint 2010</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/upXnxKWoSDY/</link>
		<comments>http://blog.henryong.com/2012/04/16/spsla-presentation-managed-metadata-and-taxonomies-in-sharepoint-2010/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 18:07:16 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[Presentation]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Information Architecture]]></category>
		<category><![CDATA[Managed Metadata]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[SharePoint Saturday]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=681</guid>
		<description><![CDATA[SharePoint Saturday Los Angeles 2012 was this past weekend in Long Beach and as promised to my session attendees, I&#8217;m posting the presentation below. Shout out to Chris McNulty as much of the content came from him. Also, thank you to all of the organizers, sponsors, speakers, volunteers, and attendees for making this event possible You may want to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=681&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sharepointsaturday.org/la/default.aspx" target="_blank">SharePoint Saturday Los Angeles 2012 </a>was this past weekend in Long Beach and as promised to my session attendees, I&#8217;m posting the presentation below. Shout out to <a href="http://www.chrismcnulty.net/SitePages/Home.aspx" target="_blank">Chris McNulty </a>as much of the content came from him. Also, thank you to all of the <a href="http://www.sharepointsaturday.org/la/Pages/about.aspx" target="_blank">organizers</a>, <a href="http://www.sharepointsaturday.org/la/Pages/sponsors.aspx" target="_blank">sponsors</a>, <a href="http://www.sharepointsaturday.org/la/Pages/speakers.aspx" target="_blank">speakers</a>, volunteers, and attendees for making this event possible <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You may want to view or download the PowerPoint from SlideShare for the complete content since I had embedded quite a few notes throughout the slides.</p>
<div id="__ss_12561213" style="width:425px;"><strong><a title="Playing Tag: Managed Metadata and Taxonomies in SharePoint 2010" href="http://www.slideshare.net/wolvie3421/playing-tag-managed-metadata-and-taxonomies-in-sharepoint-2010-12561213" target="_blank">Playing Tag: Managed Metadata and Taxonomies in SharePoint 2010</a></strong><iframe src='http://www.slideshare.net/slideshow/embed_code/12561213' width='425' height='348' scrolling='no'></iframe></p>
<div style="padding:5px 0 12px;">View more <a href="http://www.slideshare.net/thecroaker/death-by-powerpoint" target="_blank">PowerPoint</a> from <a href="http://www.slideshare.net/wolvie3421" target="_blank">Henry Ong</a></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/681/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=681&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/upXnxKWoSDY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2012/04/16/spsla-presentation-managed-metadata-and-taxonomies-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2012/04/16/spsla-presentation-managed-metadata-and-taxonomies-in-sharepoint-2010/</feedburner:origLink></item>
		<item>
		<title>SharePoint Dev: Getting null TaxonomySession and ArgumentOutOfRangeException errors on TermStore objects</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/1HPrMscybyQ/</link>
		<comments>http://blog.henryong.com/2012/03/20/sharepoint-dev-getting-null-taxonomysession-and-argumentoutofrangeexception-errors-on-termstore-objects/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 21:30:43 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint Development]]></category>
		<category><![CDATA[Managed Metadata Service]]></category>
		<category><![CDATA[Permissions]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Service Application Permissions]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=671</guid>
		<description><![CDATA[Off to a new project and today I&#8217;m exploring the SharePoint Managed Metadata and Taxonomy APIs. I had created a simple Windows Form application to test with and as I was trying to read some of terms out of the Managed Metadata Service Application, I came across a weird error that took me a while to figure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=671&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Off to a new project and today I&#8217;m exploring the <a href="http://msdn.microsoft.com/en-us/library/ee556337.aspx" target="_blank">SharePoint Managed Metadata and Taxonomy APIs</a>. I had created a simple Windows Form application to test with and as I was trying to read some of terms out of the Managed Metadata Service Application, I came across a weird error that took me a while to figure out.</p>
<p><strong>Code Snippet:</strong></p>
<pre>using (SPSite site = new SPSite(siteURL))             
{                 
   TaxonomySession session = new TaxonomySession(site);
   TermStore termStore = session.TermStores["Managed Metadata Service"];
   TermCollection terms = termStore.GetTerms(InputTerm.Text, true);
   foreach (Term term in terms)                 
   {                     
      Results.Text += term.Name + "\n";                     
      if (term.Terms.Count &gt; 0)                     
      {                         
         foreach(Term childTerm in term.Terms)                         
         {                             
            Results.Text += childTerm.Name;                         
         }
      }
   }
}</pre>
<p><strong>Error Message: </strong></p>
<p>ArgumentOutOfrangeException was unhandled. Specified argument was out of the range of valid values. Parameter name: index.</p>
<p><a href="http://henryong.files.wordpress.com/2012/03/mmserror.png"><img class="wp-image-672 aligncenter" style="border:1px solid black;" title="mmserror" src="http://henryong.files.wordpress.com/2012/03/mmserror.png?w=458&h=137" alt="" width="458" height="137" /></a> <strong></strong></p>
<p><strong>Cause:</strong></p>
<p>Digging through the properties of the session object showed that it was null so for some reason I wasn&#8217;t even able to get a handle on a <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.taxonomy.taxonomysession.aspx" target="_blank">TaxonomySession</a> object, which is the entry point to getting access to any of the information inside of your Managed Metadata Service. When cross-referenced with the Event Viewer, I see this message:</p>
<pre>Event ID: 8089
Source: SharePoint Server
Task Category: Taxonomy
Level: Warning
The Managed Metadata Service 'Managed Metadata Service' 
is inaccessible. The web application does not have 
sufficient permissions.</pre>
<p><strong>Solution:</strong></p>
<p>Since I was running Visual Studio and my test Windows Form application as myself (a user), I went to Central Administration to find out whether or not I had access to the service.</p>
<p style="text-align:center;"><a href="http://henryong.files.wordpress.com/2012/03/mmsperms.png"><img class="wp-image-673 aligncenter" style="border:1px solid black;" title="mmsperms" src="http://henryong.files.wordpress.com/2012/03/mmsperms.png?w=463&h=346" alt="" width="463" height="346" /></a></p>
<p>Lo and behold, it looks like only service accounts had access to the Managed Metadata Service. After I added my account to have at least Read Access to the Term Store, all was well and I was on my merry way again. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/671/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/671/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/671/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=671&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/1HPrMscybyQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2012/03/20/sharepoint-dev-getting-null-taxonomysession-and-argumentoutofrangeexception-errors-on-termstore-objects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/03/mmserror.png" medium="image">
			<media:title type="html">mmserror</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/03/mmsperms.png" medium="image">
			<media:title type="html">mmsperms</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2012/03/20/sharepoint-dev-getting-null-taxonomysession-and-argumentoutofrangeexception-errors-on-termstore-objects/</feedburner:origLink></item>
		<item>
		<title>Case Study on Troubleshooting a Failed SharePoint User Profile/FIM Synchronization, Bad CMYK User Photos and Disappearing User Profiles</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/XY4lieOTYac/</link>
		<comments>http://blog.henryong.com/2012/03/02/case-study-on-troubleshooting-a-failed-sharepoint-user-profilefim-synchronization-bad-cmyk-user-photos-and-disappearing-user-profiles/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 02:39:55 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[FIM]]></category>
		<category><![CDATA[SharePoint User Profiles]]></category>
		<category><![CDATA[Sync Issues]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[User Profile Service Application]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=657</guid>
		<description><![CDATA[What a mighty doozy this one was&#8230; a couple weeks, a few hairs and 7.4 panic attacks later, I think I&#8217;ve had one of the most twisted SharePoint issues I&#8217;ve ever had to deal with. In my 6 years of working with SharePoint I&#8217;ve only had to open up a support case with Microsoft one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=657&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What a mighty doozy this one was&#8230; a couple weeks, a few hairs and 7.4 panic attacks later, I think I&#8217;ve had one of the most twisted SharePoint issues I&#8217;ve ever had to deal with. In my 6 years of working with SharePoint I&#8217;ve only had to open up a support case with Microsoft one other time. I take great pride in being able to solve stuff on my own but this was just one of those that had me going in circles. Hopefully this write up will help others in the future.</p>
<p><strong>Environment</strong></p>
<ul>
<li>SharePoint 2010 Enterpise December 2011 Cumulative Update 14.0.6114.5000</li>
<li>3 Load Balanced WFEs</li>
<li>2 Application Servers</li>
<li>1 User Profile Service Application</li>
<li>User Profile Service and User Profile Synchronization Service both running on APP1 server</li>
<li>User Profile Service Application has 4 Custom User Profile Properties and 1 Property set to export to Active Directory (Picture to thumbnailPhoto)</li>
</ul>
<p>Since there were quite a few variables in troubleshooting the problems (which I haven&#8217;t mentioned yet), I&#8217;ll outline all the happenings in a timeline format.</p>
<p><strong>February 2012: Users start to use My Sites to upload their pictures</strong><br />
We&#8217;re synching these pictures to Active Directory so that they can be re-used for the users&#8217; Lync and Outlook profile pictures.</p>
<p><strong>February 11, 2012: Deployed December 2011 Cumulative Update</strong><br />
This is a story for another day but in the end everything turned out OK. Lessons learned here: be wary of synchronizations of the User Profile Service after troubleshooting UPA issues after deploying CU. Make sure you disable the &#8220;My Site Cleanup Job&#8221; and follow the guidance from <a href="http://joanneklein.wordpress.com/2011/11/08/recreated-user-profile-service-application-deletes-user-profiles/" target="_blank">Joanne Klein here</a>. I learned this the hard way.</p>
<p><strong>February 16, 2012: Installed some Windows Updates</strong><br />
Everything seemed to be normal here.</p>
<p><strong>February 22, 2012: First Reports of Users Not Seeing Their Pictures in Lync &amp; Outlook<br />
</strong>Upon inspection of Active Directory and comparing to pictures in SharePoint, there was indeed a mismatch. Photos has not been exported to AD since February 17, 2012. Uh oh, could it have been the Windows Update? Maybe a weekly Timer Job somewhere that regressed from the December 2011 CU? Maybe a combination of both? Errors reported in the FIM MIIS Client and Event Viewer pasted below:</p>
<blockquote><p><em><strong>FIMSynchronizationService Event ID 6126</strong></em></p>
<p><em>The management agent &#8220;MOSS-63649d6d-ab5f-4eda-8c6a-6e2b65a419c7&#8243; completed run profile &#8220;MOSS_DELTAIMPORT_51f827d4-b836-4851-89de-daf209327762&#8243; with a delta import or delta synchronization step type. The rules configuration has changed since the last full import or full synchronization.</em></p>
<p><em> User Action</em><br />
<em> To ensure the updated rules are applied to all objects, a run with step type of full import and full synchronization should be completed.</em></p>
<p><em><strong>FIMSynchronizationService Event ID 6801</strong></em></p>
<p><em>The extensible extension returned an unsupported error.</em><br />
<em> The stack trace is:</em></p>
<p><em> &#8220;System.Net.WebException: The remote server returned an error: (404) Not Found.</em><br />
<em> at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest&amp; request)</em><br />
<em> at System.Net.WebClient.DownloadData(Uri address)</em><br />
<em> at Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportExtension.DownloadPictures(ProfileChangeData[] profiles)</em><br />
<em> at Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportExtension.Microsoft.MetadirectoryServices.IMAExtensibleFileImport.GenerateImportFile(String fileName, String connectTo, String user, String password, ConfigParameterCollection configParameters, Boolean fFullImport, TypeDescriptionCollection types, String&amp; customData)</em><br />
<em>Forefront Identity Manager 4.0.2450.34&#8243;</em></p>
<p><a href="http://henryong.files.wordpress.com/2012/03/misserrors.png"><img class="aligncenter size-full wp-image-658" title="misserrors" src="http://henryong.files.wordpress.com/2012/03/misserrors.png?w=575" alt=""   /></a></p></blockquote>
<p>After trying to troubleshoot this for a whole day with no leads, I threw in the towel and phoned MSFT support.</p>
<p><strong>February 23-27, 2012: Working with MSFT SharePoint Support Engineer Trying to Restore the UPA<br />
</strong>In short, we worked on trying to create new UPAs in production as well as staging with restored Profile and Social Databases to no avail<strong>. </strong>There was one restore scenario that seemed to work when we left it on the Friday, but when I came in on Monday, the sync errors were happening with the new UPA as well. I also learned that there are quite a bit of URLs that are hard coded into the User Profile and Social Databases. For example, when we restored the databases to the QA environment, users in the QA environment were getting redirected to their Production My Sites. I once again thew in the towel with this Support Engineer when he suggested that there will be no way to recover the User Profile and Social DBs and that his seniors recommend that all of my users will have to recreate all of their profile information. This was completely unacceptable. By the way, if you find yourself on a support call with MSFT or anyone else for that matter, don&#8217;t always be so willing to do whatever they recommend. There were quite a few instances where I had to disagree with a troubleshooting step as it would have made my production environment unavailable to my users or result in data loss. So try to use your own best judgement and common sense when working with someone that doesn&#8217;t have to deal with your end users.</p>
<p><strong> February 28-March 1, 2012: Waiting Around for Call from Escalation Engineer&#8230; </strong><strong>But Had Some Revelations</strong><br />
Was supposed to hear back from someone after 48 hours, but did not. Instead, I had to go through some other routes to get some attention via my Technical Account Manager (TAM). In the meantime, I was sleuthing around in regards to the 404 error message and discovered that there was something<strong></strong> awry with some of the user profile pictures. I recorded this finding/bug <a href="http://social.msdn.microsoft.com/Forums/en/sharepoint2010setup/thread/5d8af3c9-9c19-4287-adab-20fabaf9e798" target="_blank">here</a>. I didn&#8217;t have a chance to validate that the FIM Sync errors are related to the bad CMYK pictures, but that was the hunch&#8230;</p>
<p><strong>March 2, 2012: Got another Support Engineer and&#8230; success! Sort of&#8230;<br />
</strong>We spent about 4 hours in total and eventually reached a semi-conclusion. So this whole entire time, a lot of attention was being paid to the UPA as that was the most probable cause for failed syncs with Active Directory.<strong> </strong>This time, instead of spending too much time trying to recreate and restore the UPA in various stages, I was able to change the troubleshooting direction to focus more on the user profile pictures instead. With this lead, the Support Engineer suggested that we remove the Picture mapping to Active Directory and then perform a Full Synchronization. Before running the Full Sync, I made mention that the last time I did this, all of  the profiles got deleted. After disabling the My Site Cleanup Job, we ran the Full Sync and were indeed able to observe that all the user profiles were marked for deletion using</p>
<blockquote><p>Select * from userprofile_full (nolock) where bDeleted = 1</p></blockquote>
<p>on the User Profile Database. That was pretty nerve-racking. We then proceeded to run a few more syncs to confirm that the user profiles were flipped back to the do not delete state.We also confirmed that there were no more sync errors. Woohoo! User profile pictures were definitely the problem, causing the FIM sync to fail.</p>
<p><strong>Resolving the bad CMYK pictures problem</strong><br />
This seems to be a bug with SharePoint and the workaround I&#8217;ve found is to delete the offending thumbnail (large thumbnail) generated by SharePoint and then replace it with the medium thumbnail (which works). You can follow that thread <a href="http://social.msdn.microsoft.com/Forums/en/sharepoint2010setup/thread/5d8af3c9-9c19-4287-adab-20fabaf9e798" target="_blank">here</a>. After resolving the picture issue, I was then again able to successfully export all the user profile images from SharePoint to Active Directory. So in retrospect, if there was an exception in the sync because of one of these images, FIM will tap out and not even attempt to export any other pictures that are working to Active Directory.</p>
<p><strong>Recap &amp; Lessons Learned</strong></p>
<ol>
<li>User Profile Service Application and FIM Sync issues do not always require a rebuild of the UPA.</li>
<li>If you rebuild your Sync DB or Connection to Active Directory, you will lose all of your Profile Property Mappings.</li>
<li>If you rebuild your Sync DB or Connection to Active Directory, your next sync (either incremental or full, first incremental will force a full) will result in all of your profiles getting marked for deletion.</li>
<li>To prevent your User Profiles from getting deleted, disable the My Site Cleanup Timer Job.</li>
<li>Don&#8217;t believe the Support Engineer when he says it&#8217;s not possible to restore the Profile and Social DBs (YMMV).</li>
<li>Don&#8217;t perform recommended actions that may cause downtime or loss of data. Use your common sense and don&#8217;t jeopardize your users&#8217; data.</li>
<li>You know your environment the best and sometimes you have to go with your gut on an issue. Having a second pair of eyes and helpful suggestions was definitely appreciated but if I had let the Support Engineers continue their scripts, we would still be trying to recreate and restoring the UPA to no avail.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/657/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=657&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/XY4lieOTYac" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2012/03/02/case-study-on-troubleshooting-a-failed-sharepoint-user-profilefim-synchronization-bad-cmyk-user-photos-and-disappearing-user-profiles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2012/03/misserrors.png" medium="image">
			<media:title type="html">misserrors</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2012/03/02/case-study-on-troubleshooting-a-failed-sharepoint-user-profilefim-synchronization-bad-cmyk-user-photos-and-disappearing-user-profiles/</feedburner:origLink></item>
		<item>
		<title>Synching AlertSite Devices List with a SharePoint List via AlertSite’s REST API + PowerShell</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/SVEUfmT-t3g/</link>
		<comments>http://blog.henryong.com/2011/12/30/synching-alertsite-devices-list-with-a-sharepoint-list-via-alertsites-rest-api-powershell/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 01:03:40 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[AlertSite]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Development]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[parsed xml]]></category>
		<category><![CDATA[REST API]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=645</guid>
		<description><![CDATA[This one&#8217;s a little bit more obscure than usual as I&#8217;m not sure how many people use SmartBear Software&#8217;s AlertSite service or not. If not, then this should be a good demonstration of how we can use PowerShell to connect to remote REST APIs and then sync the parsed XML response/information to a custom SharePoint List [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=645&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This one&#8217;s a little bit more obscure than usual as I&#8217;m not sure how many people use <a href="http://smartbear.com" target="_blank">SmartBear Software&#8217;s</a> <a href="http://smartbear.com/products/web-performance-management/web-performance-monitoring/" target="_blank">AlertSite</a> service or not. If not, then this should be a good demonstration of how we can use PowerShell to connect to remote REST APIs and then sync the parsed XML response/information to a custom SharePoint List <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . On the otherhand, if you don&#8217;t care about SharePoint then this demo would also be a good code sample for the .NET crowd as well since AlertSite only has <a href="http://help.alertsite.com/AlertSite/RestAPI?skin=clean.nat%2cnat#5_2_Example_of_REST_API_using_Pe" target="_blank">sample code using Perl</a>.</p>
<p>This script assumes that there is a custom SharePoint List created with the following fields:</p>
<p><strong>Title &#8211; Single Line of Text (default)</strong><br />
<strong>MonitorInterval &#8211; Number</strong><br />
<strong>BeingMonitored &#8211; Yes/No</strong><br />
<strong>NotifyOnError &#8211; Yes/No</strong><br />
<strong>Traceroute &#8211; Yes/No</strong><br />
<strong>MonitorTimeout &#8211; Number</strong></p>
<p>Once you create the fields using the names above, feel free to change the display names. The script will work with the internal field names that are static.</p>
<p><a href="http://henryong.com/AlertSiteToSharePointRESTAPI.ps1" target="_blank">Click here </a>to download the PS1.</p>
<p>PowerShell Script pasted below for search purposes.<br />
You may need to highlight and copy the script below into notepad to be able to read all of the characters that were chopped off by this blog’s layout.</p>
<pre>######################################################################################################
# This script will log into AlertSite's REST API and sync the account's devices with a SharePoint List
#
# Author: Henry Ong
#
# AlertSite Documentation: 
# http://help.alertsite.com/AlertSite/RestAPI?skin=clean.nat%2cnat#5_1_Example_of_Report_API
######################################################################################################

############# Start Variables ################
$RESTServer = "https://www.alertsite.com/restapi"
$login = "YourEmailAddress"
$password = "YourPassword"
$postLogin = "&lt;Login&gt;&lt;Login&gt;$login&lt;/Login&gt;&lt;Password&gt;$password&lt;/Password&gt;&lt;/Login&gt;"
$devicesRequest = "&lt;List&gt;&lt;APIVersion&gt;1.1&lt;/APIVersion&gt;&lt;TxnHeader&gt;&lt;Request&gt;&lt;Login&gt;$login&lt;/Login&gt;&lt;SessionID&gt;$sessionID&lt;/SessionID&gt;&lt;/Request&gt;&lt;/TxnHeader&gt;&lt;Source&gt;&lt;/Source&gt;&lt;/List&gt;"
$SPWebURL = "YourSharePointSiteURL"
$SPListName = "AlertSite Devices"
############# End Variables ##################

[System.Reflection.Assembly]::LoadWithPartialName("System.Net")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

##############################################
## Setup user agent and login request
##############################################
$encode = [System.Text.Encoding]::UTF8
$loginBytes = $encode.GetBytes($postLogin)

## Creating and posting a request to AlertSite's REST API Login page
$req = [System.Net.WebRequest]::Create($RESTServer + "/user/login")
$req.Method = "POST"
$req.ContentType = "text/xml"
$req.ContentLength = $loginBytes.Length
$req.UserAgent = "AlertSite REST Client/1.0"

$reqStream = $req.GetRequestStream()
$reqStream.Write($loginBytes, 0, $loginBytes.Length)
$reqStream.Close()

## Working with the response sent back from AlertSite
$resp = $req.GetResponse()
$cookie = $resp.Headers["Set-Cookie"]

$responseStream = $resp.GetResponseStream()
$respReader = (New-Object System.IO.StreamReader($responseStream))
$XMLResponse = $respReader.ReadToEnd()
$responseStream.Close()

# Save Session ID and Customer Object ID for subsequent API calls
$XMLEncoded = [xml]$XMLResponse

$sessionID = $XMLEncoded.Response.SessionID
$objCust = $XMLEncoded.Response.ObjCust
$resp.Close()

##############################################
## Getting the list of devices from AlertSite
##############################################

$encode = [System.Text.Encoding]::UTF8
$listDeviceBytes = $encode.GetBytes($devicesRequest)

$req = [System.Net.WebRequest]::Create($RESTServer + "/devices/list")
$req.Method = "POST"
$req.ContentType = "text/xml"
$req.ContentLength = $listDeviceBytes.Length
$req.UserAgent = "AlertSite REST Client/1.0"
$req.Headers.Add("Cookie", $cookie)

$reqStream = $req.GetRequestStream()
$reqStream.Write($listDeviceBytes, 0, $listDeviceBytes.Length)
$reqStream.Close()

$resp = $req.GetResponse()

$responseStream = $resp.GetResponseStream()
$respReader = (New-Object System.IO.StreamReader($responseStream))
$XMLResponse = $respReader.ReadToEnd()
$responseStream.Close()

$XMLEncoded = [xml]$XMLResponse
$resp.Close()

###########################################
# Update SharePoint List
###########################################

$site = New-Object Microsoft.SharePoint.SPSite($SPWebURL)
$web = $site.OpenWeb()
$deviceList = $web.Lists[$SPListName]

foreach($device in $XMLEncoded.Response.TxnList.Txn)
{
    $deviceName = InjectSpaces $device.TxnName
    $interval = $device.TxnDetail.GetAttribute("Interval")
    $monitored = ReturnBoolFromLetter $device.TxnDetail.GetAttribute("Monitor")
    $notify = ReturnBoolFromLetter $device.TxnDetail.GetAttribute("Notify")
    $traceRoute = ReturnBoolFromLetter $device.TxnDetail.GetAttribute("TraceError")
    $timeout = $device.TxnDetail.GetAttribute("TimeOut")

    $listItem = FindDeviceInSharePoint $deviceName

	if($listItem -eq $null)
    {        
        CreateNewListItem $deviceList $deviceName $interval $monitored $notify $traceRoute $timeout
    }

    elseif($listItem -ne $null)
    {
        UpdateListItem $listItem $deviceName $interval $monitored $notify $traceRoute $timeout
    }

}

$spweb.dispose()
$spsite.dispose()

####################################################################################################
## This function will replace the "%20" characters in the string with spaces.
####################################################################################################
function InjectSpaces($string)
{
	$newString = $string.replace("%20", " ")
	return $newString
}

####################################################################################################
## This function will return the SharePoint List Item that represents the device if it exists.
####################################################################################################
function FindDeviceInSharePoint($device)
{
	$listQuery = New-Object Microsoft.SharePoint.SPQuery
	$listQuery.Query = "&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='Title' /&gt;&lt;Value Type='Text'&gt;" + $device + "&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;"
	$itemCollection = $deviceList.GetItems($listQuery)
	if($itemCollection.count -eq 1)
	{
		return $itemCollection[0]
	}
	else
	{
		return $null 
	}
}

####################################################################################################
## This function will create a new SharePoint List Item to represent the AlertSite Device if 
## it doesn't exist.
####################################################################################################
function CreateNewListItem($spList, $deviceName, $monitorInterval, $beingMonitored, $notifyOnError, $traceRouteOnError, $monitorTimeout)
{
    $listItem = $spList.Items.Add()
    $listItem["Title"] = $deviceName
    $listItem["MonitorInterval"] = $monitorInterval
    $listItem["BeingMonitored"] = $beingMonitored
    $listItem["NotifyOnError"] = $notifyOnError
    $listItem["Traceroute"] = $traceRouteOnError
    $listItem["MonitorTimeout"] = $monitorTimeout
    $listItem.update()
}

####################################################################################################
## This function will update an existing SharePoint List Item that represents an AlertSite Device.
####################################################################################################
function UpdateListItem($listItem, $deviceName, $monitorInterval, $beingMonitored, $notifyOnError, $traceRouteOnError, $monitorTimeout)
{
    $listItem["MonitorInterval"] = $monitorInterval
    $listItem["BeingMonitored"] = $beingMonitored
    $listItem["NotifyOnError"] = $notifyOnError
    $listItem["Traceroute"] = $traceRouteOnError
    $listItem["MonitorTimeout"] = $monitorTimeout
    $listItem.update()
}
####################################################################################################
## This function will convert the AlertSite attributes for SharePoint consumption.
####################################################################################################
function ReturnBoolFromLetter($letter)
{
    if($letter -eq "y")
    {
        return $true
    }

    elseif($letter -eq "n")
    {
        return $false
    }
}</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/645/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=645&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/SVEUfmT-t3g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2011/12/30/synching-alertsite-devices-list-with-a-sharepoint-list-via-alertsites-rest-api-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2011/12/30/synching-alertsite-devices-list-with-a-sharepoint-list-via-alertsites-rest-api-powershell/</feedburner:origLink></item>
		<item>
		<title>SharePoint Web Page/Valid Site Monitoring with Email Alerts PowerShell Script</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/GUNHj5GTxro/</link>
		<comments>http://blog.henryong.com/2011/11/30/sharepoint-web-pagevalid-site-monitoring-with-email-alerts-powershell-script/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 00:14:26 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Alerts]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=637</guid>
		<description><![CDATA[Two scripts in two days? Am I out of my mind?! Yes, no, yes, maybe&#8230; Yesterday&#8217;s SharePoint Diagnostic Log Monitor + Email Alert PowerShell Script worked so well that I was getting bombarded with too many emails! Yes, they were all critical as far as SharePoint was concerned and I was able to resolve a great [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=637&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Two scripts in two days? Am I out of my mind?! Yes, no, yes, maybe&#8230; Yesterday&#8217;s <a title="Permalink to SharePoint Diagnostic Log Monitor + Email Alert PowerShell Script" href="http://blog.henryong.com/2011/11/29/sharepoint-diagnostic-log-monitor-email-alert-powershell-script/" rel="bookmark">SharePoint Diagnostic Log Monitor + Email Alert PowerShell Script</a> worked so well that I was getting bombarded with too many emails! Yes, they were all critical as far as SharePoint was concerned and I was able to resolve a great majority of them. But some of them just seemed to be inherent to SharePoint and didn&#8217;t really affect the end-user experience therefore the criticality of these alerts became less of a priority.</p>
<p>So today I went about bootlegging a different type of monitoring system that would be more indicative of an end user&#8217;s experience with the site. With this script, I wanted to connect to the SharePoint sites and see if I get a valid response or valid content back from the server. If I can&#8217;t download the page with the System.Net.WebClient.DownloadString() method, then it&#8217;ll throw an exception and that&#8217;s how I&#8217;ll know whether the site is accessible by an end-user or not. If it&#8217;s not accessible, then an email will be generated and sent to me. Pretty cool eh?</p>
<p>This is extra useful when used in an environment with load balanced front ends and you want to know exactly which server is having issues. If you want to use this script in this manner, then make sure you create the scheduled tasks for each server.</p>
<p><strong>Sample Email Output:</strong></p>
<p><strong>URL:</strong> https://url1<br />
<strong>Server:</strong> ALW01</p>
<p><strong>Exception:</strong> System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest&amp; request) at System.Net.WebClient.DownloadString(Uri address) at DownloadString(Object , Object[] ) at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)</p>
<p>===================================</p>
<p><strong>URL:</strong> https://url2<br />
<strong>Server:</strong> ALW02</p>
<p><strong>Exception:</strong> System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest&amp; request) at System.Net.WebClient.DownloadString(Uri address) at DownloadString(Object , Object[] ) at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)</p>
<p>===================================</p>
<p>You may need to highlight and copy the script below into notepad to be able to read all of the characters that were chopped off by this blog’s layout.</p>
<pre>############# Start Variables ################
$urls = @("<a href="https://url1">https://url1</a>", "<a href="https://url2">https://url2</a>")
$emailFrom = "<a href="mailto:SharePoint.Automation@email.com">SharePoint.Automation@email.com</a>"
$emailTo = @("email1","email2")
$subject = "SharePoint Down!"
$smtpserver = "SMTPServer"
$server = "ALW01"
# When used in a load-balanced environment where
# each server has host entries to itself, this can help you
# identify which server is having issues.
############# End Variables ##################

[System.Reflection.Assembly]::LoadWithPartialName("System.Net")
$wc = New-Object System.Net.WebClient 
$wc.UseDefaultCredentials = $true
$body = ""

foreach($url in $urls)
{  
    try  
    {   
        $page = $wc.DownloadString($url);   
        if($page.Contains("An unexpected error has occurred.") -or $page.Contains("Cannot connect to the configuration database"))   
        {    
            $body += "&lt;b&gt;URL:&lt;/b&gt; " + $url + "&lt;br&gt;&lt;br&gt;"    
            $body += "&lt;b&gt;Server:&lt;/b&gt; " + $server + "&lt;br&gt;&lt;br&gt;"    
            $body += "&lt;b&gt;Exception:&lt;/b&gt; " + "Getting a nasty error. Please help me." + "&lt;br&gt;&lt;br&gt;"    
            $body += "===================================&lt;br&gt;&lt;br&gt;"    
        }  
    }  

    catch [Exception]  
    {   
        $body += "&lt;b&gt;URL:&lt;/b&gt; " + $url + "&lt;br&gt;&lt;br&gt;"   
        $body += "&lt;b&gt;Server:&lt;/b&gt; " + $server + "&lt;br&gt;&lt;br&gt;"   
        $body += "&lt;b&gt;Exception:&lt;/b&gt; " + $_.Exception + "&lt;br&gt;&lt;br&gt;"   
        $body += "===================================&lt;br&gt;&lt;br&gt;"   
    }
}

if($body -ne "")
{  
    Send-MailMessage -To $emailTo -Subject $subject -Body $body -SmtpServer $smtpserver -From $emailFrom -BodyAsHtml
}</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/637/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/637/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/637/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/637/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/637/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/637/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/637/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/637/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=637&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/GUNHj5GTxro" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2011/11/30/sharepoint-web-pagevalid-site-monitoring-with-email-alerts-powershell-script/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2011/11/30/sharepoint-web-pagevalid-site-monitoring-with-email-alerts-powershell-script/</feedburner:origLink></item>
		<item>
		<title>SharePoint Diagnostic Log Monitor + Email Alert PowerShell Script</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/MaDI6NJE4CI/</link>
		<comments>http://blog.henryong.com/2011/11/29/sharepoint-diagnostic-log-monitor-email-alert-powershell-script/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 23:29:27 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Alerts]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://henryong.wordpress.com/?p=631</guid>
		<description><![CDATA[Looking for a bootleg SharePoint monitoring and alert system? Well, you&#8217;ve come to the right place! I wrote the following PowerShell script to be run as a scheduled task against SharePoint&#8217;s Diagnostic Logs. It will not only find the latest log file to analyze, but it will slice and dice through that current log file for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=631&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Looking for a bootleg SharePoint monitoring and alert system? Well, you&#8217;ve come to the right place! I wrote the following PowerShell script to be <a href="http://dmitrysotnikov.wordpress.com/2011/02/03/how-to-schedule-a-powershell-script/" target="_blank">run as a scheduled task</a> against SharePoint&#8217;s Diagnostic Logs. It will not only find the latest log file to analyze, but it will slice and dice through that current log file for the most critical &#8220;Critical&#8221; events. Once it finds those Critical events that are usually indicative of something really wrong with your environment, it&#8217;ll package up all of the messages in an HTML email and send it your way.</p>
<p>You may need to highlight and copy the script below into notepad to be able to read all of the characters that were chopped off by this blog&#8217;s layout.</p>
<pre>############# Start Variables ################ 
$logDirectory = "D:\Logs\Diagnostic Logs\*.log" 
$emailFrom = "FromEmailAddress" 
$emailTo = @("Email1","Email2") 
$subject = "SharePoint Diagnostics Critical Alert" 
$smtpserver = "EmailServer" 
############# End Variables ##################
$latestLogFile = get-childitem $logDirectory | sort LastWriteTime -desc | select -first 1
$criticalItems = Select-String $latestLogFile.FullName -Pattern "Critical"
if($criticalItems -ne $null) 
{  
     $body = ""  
     foreach($criticalItem in $criticalItems)  
     {   
         $body += "&lt;b&gt;Error:&lt;/b&gt; " + $criticalItem.Line + "&lt;br&gt;&lt;br&gt;"   
         $body += "&lt;b&gt;Line Number:&lt;/b&gt; " + $criticalItem.LineNumber + "&lt;br&gt;&lt;br&gt;"   
         $body += "&lt;b&gt;File Path:&lt;/b&gt; " + $criticalItem.Path + "&lt;br&gt;&lt;br&gt;"   
         $body += "===================================&lt;br&gt;&lt;br&gt;"  
     }    

     Send-MailMessage -To $emailTo -Subject $subject -Body $body -SmtpServer $smtpserver -From $emailFrom -BodyAsHtml 
}</pre>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/631/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=631&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/MaDI6NJE4CI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2011/11/29/sharepoint-diagnostic-log-monitor-email-alert-powershell-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2011/11/29/sharepoint-diagnostic-log-monitor-email-alert-powershell-script/</feedburner:origLink></item>
		<item>
		<title>Adding SharePoint Social Rating Stars to the Homepage of SharePoint Blog Sites</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/-600d9FUsGc/</link>
		<comments>http://blog.henryong.com/2011/10/28/adding-sharepoint-social-rating-stars-to-the-homepage-of-sharepoint-blog-sites/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 19:57:32 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Blog XSL]]></category>
		<category><![CDATA[Ideation Site]]></category>
		<category><![CDATA[Rating Stars]]></category>
		<category><![CDATA[Social Rating]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=612</guid>
		<description><![CDATA[The goal of this adventure was to leverage the SharePoint blog site template and SharePoint Social Rating capabilities to construct an ideation type of site. But alas, this was one of those things that took me an ungodly amount of time to try and figure out a solution for&#8230; hopefully this post will be able to help others [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=612&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The goal of this adventure was to leverage the SharePoint blog site template and SharePoint Social Rating capabilities to construct an ideation type of site.</p>
<p>But alas, this was one of those things that took me an ungodly amount of time to try and figure out a solution for&#8230; hopefully this post will be able to help others solve the same problem. Yes, there are lots of blog posts out there that show how we can add the rating capabilities to individual blog post entries, but I couldn&#8217;t find one that described the process for adding the rating stars to the homepage of the blog site template&#8217;s summary view web part for each of the posts. With some help with the <a href="http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/6c2d1e4d-9405-4cf3-8c6c-e18b5fad4720/?prof=required" target="_blank">MSDN SharePoint Forums</a> and a fellow by the name of <a href="http://moss-solutions.blogspot.com/" target="_blank">Raghavendra Shanbhag</a>, we figured it out with the steps outlined below.</p>
<p>1. Assuming that your blog site has been created, turn on ratings for your Posts Document Library as <a href="http://office.microsoft.com/en-us/sharepoint-server-help/enable-users-to-rate-content-HA101791797.aspx" target="_blank">described here</a>.</p>
<p>2. Download this custom <a href="http://henryong.com/blog.xsl" target="_blank">blog.xsl</a> file and upload it to a Style Library or any other Document Library of your choice. Note at around line 121 is where we added the AverageRating field to the output which is the only customization that was performed on the original XSL.</p>
<p>3. Open the blog site homepage and edit it in SharePoint Designer. Here, you&#8217;ll want to click on the Posts web part and add the Rating (0-5) column for the field to be displayed in the view.</p>
<p><a href="http://henryong.files.wordpress.com/2011/10/addcolumnratingstars.png"><img class="aligncenter size-full wp-image-613" title="Add Column Rating Stars" src="http://henryong.files.wordpress.com/2011/10/addcolumnratingstars.png?w=575" alt=""   /></a></p>
<p>4. While you&#8217;re in SharePoint Designer, you can also include a link to the custom XSL that you had uploaded in Step 2.</p>
<p><a href="http://henryong.files.wordpress.com/2011/10/xsllink.png"><img class="aligncenter size-full wp-image-614" title="XSLLink" src="http://henryong.files.wordpress.com/2011/10/xsllink.png?w=575" alt=""   /></a></p>
<p>5. Now go ahead and save all the changes that you&#8217;ve made in SharePoint Designer and then head over to your blog site in the browser. You should now see the rating stars below the title of each of your posts but you&#8217;ll find that they are not clickable/interactive. What you&#8217;ll want to do here is to edit the homepage of that blog site and then add another instance of the Posts list to one of the web part zones. After you add it, change the view on that web part to the &#8220;All Posts&#8221; view which should contain the rating stars. By adding this web part, it registers the necessary javascripts and CSS for the rating stars to properly function. But we don&#8217;t want to have a duplicate set of posts on our homepage right? What we can do here is mark the 2nd Posts web part as hidden!</p>
<p><a href="http://henryong.files.wordpress.com/2011/10/hidewebpart.png"><img class="aligncenter size-full wp-image-615" title="HideWebPart" src="http://henryong.files.wordpress.com/2011/10/hidewebpart.png?w=575" alt=""   /></a></p>
<p>And with that, we have now transformed a SharePoint blog site into an ideation site <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://henryong.files.wordpress.com/2011/10/ratingstarsendresult2.png"><img class="aligncenter size-full wp-image-627" title="ratingstarsendresult" src="http://henryong.files.wordpress.com/2011/10/ratingstarsendresult2.png?w=575" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/612/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/612/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/612/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=612&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/-600d9FUsGc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2011/10/28/adding-sharepoint-social-rating-stars-to-the-homepage-of-sharepoint-blog-sites/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2011/10/addcolumnratingstars.png" medium="image">
			<media:title type="html">Add Column Rating Stars</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2011/10/xsllink.png" medium="image">
			<media:title type="html">XSLLink</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2011/10/hidewebpart.png" medium="image">
			<media:title type="html">HideWebPart</media:title>
		</media:content>

		<media:content url="http://henryong.files.wordpress.com/2011/10/ratingstarsendresult2.png" medium="image">
			<media:title type="html">ratingstarsendresult</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2011/10/28/adding-sharepoint-social-rating-stars-to-the-homepage-of-sharepoint-blog-sites/</feedburner:origLink></item>
		<item>
		<title>SharePoint 2010 Intermittent Search Errors &amp; Web Services Round Robin Service Load Balancer Event: EndpointFailure</title>
		<link>http://feedproxy.google.com/~r/TheArtOfEvolution/~3/EnhPvvpwEi8/</link>
		<comments>http://blog.henryong.com/2011/10/18/sharepoint-2010-intermittent-search-errors-web-services-round-robin-service-load-balancer-event-endpointfailure/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 01:26:51 +0000</pubDate>
		<dc:creator>Henry</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.henryong.com/?p=609</guid>
		<description><![CDATA[Environment: SharePoint 2010 Enterprise 3 WFE&#8217;s each with Query Roles 2 App Servers with 1 Dedicated Indexer Error in Event Viewer: Event ID: 8313 SharePoint Web Services Round Robin Service Load Balancer Event: EndpointFailure Process Name: w3wp Process ID: 5948 AppDomain Name: /LM/W3SVC/303076968/ROOT-1-129634027688317155 AppDomain ID: 2 Service Application Uri: urn:schemas-microsoft-com:sharepoint:service:767f7d712e064db3bb8945d9d42d0e12#authority=urn:uuid:f7625c7a33924a9981c0206f8bf0054a&#38;authority=https://applicationserver:32844/Topology/topology.svc Active Endpoints: 3 Failed Endpoints:1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=609&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Environment:</strong></p>
<p>SharePoint 2010 Enterprise<br />
3 WFE&#8217;s each with Query Roles<br />
2 App Servers with 1 Dedicated Indexer</p>
<p><strong>Error in Event Viewer:</strong></p>
<p>Event ID: 8313</p>
<p>SharePoint Web Services Round Robin Service Load Balancer Event: EndpointFailure</p>
<p>Process Name: w3wp</p>
<p>Process ID: 5948</p>
<p>AppDomain Name: /LM/W3SVC/303076968/ROOT-1-129634027688317155</p>
<p>AppDomain ID: 2</p>
<p>Service Application Uri: urn:schemas-microsoft-com:sharepoint:service:767f7d712e064db3bb8945d9d42d0e12#authority=urn:uuid:f7625c7a33924a9981c0206f8bf0054a&amp;authority=https://applicationserver:32844/Topology/topology.svc</p>
<p>Active Endpoints: 3</p>
<p>Failed Endpoints:1</p>
<p>Affected Endpoint: http://applicationserver:32843/767f7d712e064db3bb8945d9d42d0e12/SearchService.svc</p>
<p><strong>Error in Diagnostic Logs:</strong></p>
<p>Internal server error exception: System.ServiceModel.ServerTooBusyException: The HTTP service located at http://applicationserver:32843/767f7d712e064db3bb8945d9d42d0e12/SearchService.svc is too busy.  &#8212;&gt; System.Net.WebException: The remote server returned an error: (503) Server Unavailable.     at System.Net.HttpWebRequest.GetResponse()     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)</p>
<p><strong>Troubleshooting Steps:</strong></p>
<p>I tried to access the web service that SharePoint was trying to get to via the browser and noticed that it was reporting a 503 error as reported in the Diagnostic Logs. Then I hopped onto IIS on the affected servers and looked at the SharePoint Web Services web application (IIS) in search for a corresponding Service Application GUID that matched. The application didn&#8217;t exist on either of the application servers so that would cause the EndpointFailure as reported in the Event Viewer logs. I then double checked the <strong>Services on Server</strong> page for the application servers to make sure that the search services were turned on as having these turned on would provision the web services. They were all started which threw a little confusion my way but with some hints from this <a href="http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/1eaaba91-6c18-4bdb-9999-128f56302a7b/" target="_blank">forum post</a>, I went ahead and stopped/started the <strong>Search Query and Site Settings Service. </strong>After a little while, assuming that some timer jobs had to run, the Service Application with the missing GUID showed up in IIS and the error stopped appearing in the Event logs.</p>
<p><strong>Summarized Solution:</strong></p>
<p>1. Go to your Services on Server page in Central Administration.</p>
<p>2. Stop and Start the Search Query and Site Settings Service on each affected server as reported in the Event Viewer or SharePoint Diagnostic Logs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/henryong.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/henryong.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/henryong.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/henryong.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/henryong.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/henryong.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/henryong.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/henryong.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/henryong.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/henryong.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/henryong.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/henryong.wordpress.com/609/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/henryong.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/henryong.wordpress.com/609/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.henryong.com&#038;blog=704359&#038;post=609&#038;subd=henryong&#038;ref=&#038;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/TheArtOfEvolution/~4/EnhPvvpwEi8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henryong.com/2011/10/18/sharepoint-2010-intermittent-search-errors-web-services-round-robin-service-load-balancer-event-endpointfailure/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/38c243c201cb2794d67f6250ef1f7251?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">wolvie3421</media:title>
		</media:content>
	<feedburner:origLink>http://blog.henryong.com/2011/10/18/sharepoint-2010-intermittent-search-errors-web-services-round-robin-service-load-balancer-event-endpointfailure/</feedburner:origLink></item>
	</channel>
</rss>

