<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Of Ones and Zeros</title>
    <description>A discussion of technology and software development
</description>
    <link>http://ofonesandzeros.com/</link>
    <atom:link href="http://ofonesandzeros.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Tue, 05 Feb 2019 22:04:58 +0000</pubDate>
    <lastBuildDate>Tue, 05 Feb 2019 22:04:58 +0000</lastBuildDate>
    <generator>Jekyll v3.7.4</generator>
    
      <item>
        <title>FAST Search Links Missing from FAST Search Center</title>
        <description>&lt;p&gt;If you create a FAST Search Center based on the FAST Search Center Site Collection template, you may find that the FAST Search links are missing within the &quot;Site Collection Settings&quot; in Site Settings.  If this is the case, you need to fire up PowerShell and add the SearchExtensions feature to the site collection using the following code (from Neil Richards at &lt;a href=&quot;http://www.neilrichards.net/blog/?p=149&quot; title=&quot;http://www.neilrichards.net/blog/?p=149&quot;&gt;http://www.neilrichards.net/blog/?p=149&lt;/a&gt;):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;PS C:&lt;span class=&quot;se&quot;&gt;\U&lt;/span&gt;sers&lt;span class=&quot;se&quot;&gt;\A&lt;/span&gt;dministrator&amp;gt; Get-SPFeature | ? &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$_&lt;/span&gt;.id &lt;span class=&quot;nt&quot;&gt;-eq&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;5EAC763D-FBF5-4d6f-A76B-EDED7DD7B0A5&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

Result:
DisplayName                    Id                                       Scope
&lt;span class=&quot;nt&quot;&gt;-----------&lt;/span&gt;                    &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt;                                       &lt;span class=&quot;nt&quot;&gt;-----&lt;/span&gt;
SearchExtensions               5eac763d-fbf5-4d6f-a76b-eded7dd7b0a5     Site


PS C:&lt;span class=&quot;se&quot;&gt;\U&lt;/span&gt;sers&lt;span class=&quot;se&quot;&gt;\A&lt;/span&gt;dministrator&amp;gt; &lt;span class=&quot;nv&quot;&gt;$siteWithNoFastFeatures&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; get-SPSite http://your SP SITE NAME FOR FAST COLLECTION &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;ADD UR OWN url&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
PS C:&lt;span class=&quot;se&quot;&gt;\U&lt;/span&gt;sers&lt;span class=&quot;se&quot;&gt;\A&lt;/span&gt;dministrator&amp;gt; &lt;span class=&quot;nv&quot;&gt;$siteWithNoFastFeatures&lt;/span&gt;.Features.Add&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5EAC763D-FBF5-4d6f-A76B-EDED7DD7B0A5&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

Result:
DefinitionId           : 5eac763d-fbf5-4d6f-a76b-eded7dd7b0a5
Parent                 : SPSite &lt;span class=&quot;nv&quot;&gt;Url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;http:// SP FAST NAME &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;ur OWN url&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Properties             : &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;
Definition             : SPFeatureDefinition &lt;span class=&quot;nv&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;FeatureDefinition/5eac763d-fbf5-4d6f-a76b-eded7dd7b0a5
Version                : 14.0.0.0
FeatureDefinitionScope : Farm&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
</description>
        <pubDate>Wed, 02 May 2012 17:31:03 +0000</pubDate>
        <link>http://ofonesandzeros.com/2012/05/02/fast-search-links-missing-from-fast-search-center/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2012/05/02/fast-search-links-missing-from-fast-search-center/</guid>
        
        <category>fast</category>
        
        <category>SharePoint</category>
        
        
        <category>SharePoint</category>
        
      </item>
    
      <item>
        <title>Locating MySQL Root Password for Plesk 10 Client Server</title>
        <description>&lt;p&gt;If you need to access the client MySQL instance on your Plesk 10.x box, you will need to connect to the admin instance first.  To do that, do the following:&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&quot;%plesk_dir%mysqlbinmysql&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-P8306&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-uadmin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-pyour_password&lt;/span&gt; psa&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The password for connecting to the plesk admin instance is the same as your plesk admin password.  If you need a refresher, run the following:&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&quot;%plesk_cli%admin&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--show-password&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Okay, so once you've connected to the admin instance, you will want to execute the following:&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;k&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;databaseservers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The results will give you not only the admin username and password for the client MySQL instance, but also MSSQL if you have it installed.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
</description>
        <pubDate>Fri, 11 Nov 2011 02:17:51 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/11/11/locating-mysql-root-password-for-plesk-10-client-server/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/11/11/locating-mysql-root-password-for-plesk-10-client-server/</guid>
        
        <category>mysql</category>
        
        <category>plesk</category>
        
        
        <category>Windows</category>
        
      </item>
    
      <item>
        <title>AllowUnsafeUpdates Error Updating User Profile Information</title>
        <description>&lt;p&gt;My customer has a requirement to track the last login date/time for each SharePoint user so that they can disable accounts that have not had any activity for a time period.  I decided to implement this requirement by creating an HttpHandler and tying a jQuery .post call into the custom masterpage.  The HttpHandler would then update a property, LastLogin, that has been added to the user profile service application.&lt;/p&gt;
&lt;p&gt;The issue I ran into is that SharePoint would constantly complain about not allowing updates via a GET, and that I needed to set the AllowUnsafeUpdates property on the SPWeb object.  Sounds simple and straight forward enough, and oddly this was an instance where not only did SharePoint give you a decent error, it even went so far as to propose a solution!  Double word score!  Unfortunately it took forever to figure out WHICH SPWeb object it was talking about!  Check out the following code:&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c#&quot; data-lang=&quot;c#&quot;&gt;&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;UpdateUserLastLogin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;HttpContext&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;siteURL&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Site&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SPSecurity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;RunWithElevatedPrivileges&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;delegate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SPSite&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;site&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SPSite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Site&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SPWeb&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;web&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;OpenWeb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// this is the important bit&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Site&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllowUnsafeUpdates&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllowUnsafeUpdates&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;SPServiceContext&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serviceContext&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SPServiceContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;UserProfileManager&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;profileManager&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;UserProfileManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;serviceContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;UserProfile&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;profile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;profileManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;UserExists&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CurrentUser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;LoginName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;profile&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;profileManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;CreateUserProfile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CurrentUser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;LoginName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;profile&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;profileManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetUserProfile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CurrentUser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;LoginName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;profile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;LastLogin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Now&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;profile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Commit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllowUnsafeUpdates&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;SPContext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Current&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Site&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllowUnsafeUpdates&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;So if you look at the part commented &quot;This is the important bit&quot; you will see AllowUnsafeUpdates getting set.  This is what I finally came to which actually worked.  Previously I tried the following:&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c#&quot; data-lang=&quot;c#&quot;&gt;&lt;span class=&quot;n&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllowUnsafeUpdates&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllowUnsafeUpdates&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;And that did not work at all.  So I'm still not completely clear why setting it on the SPContext.Current.Web works, considering that I am spinning up new instances of SPSite and SPWeb and sending them to UserProfileManager, but whatever.  I'll take it.&lt;/p&gt;
&lt;p&gt;If anyone can explain why this works that would be awesome, in the meantime I'll keep this handy incase I run across this dreaded error in the future.&lt;/p&gt;
</description>
        <pubDate>Thu, 10 Nov 2011 18:33:34 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/11/10/allowunsafeupdates-error-updating-user-profile-information/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/11/10/allowunsafeupdates-error-updating-user-profile-information/</guid>
        
        <category>SharePoint</category>
        
        <category>upa</category>
        
        <category>user profile</category>
        
        
        <category>Technology</category>
        
        <category>SharePoint</category>
        
      </item>
    
      <item>
        <title>XSL for Displaying Raw XML in XsltListViewWebPart</title>
        <description>&lt;p&gt;I am writing this post so that I can hopefully save myself time in the future from trying to track down this little snippet that will take the incoming XML to an XsltListViewWebPart and render it out.  This is the snippet:&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-xml&quot; data-lang=&quot;xml&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;xsl:stylesheet&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xmlns:xsl=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://www.w3.org/1999/XSL/Transform&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;xsl:output&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;method=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;xml&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;encoding=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;indent=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;yes&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;xsl:template&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;match=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;xmp&amp;gt;&amp;lt;xsl:copy-of&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;select=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;*&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&amp;lt;/xmp&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/xsl:template&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This snippet comes from a community content comment on MSDN:  http://msdn.microsoft.com/en-us/library/ff602042.aspx.&lt;/p&gt;
</description>
        <pubDate>Mon, 31 Oct 2011 18:39:34 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/10/31/xsl-for-displaying-raw-xml-in-xsltlistviewwebpart/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/10/31/xsl-for-displaying-raw-xml-in-xsltlistviewwebpart/</guid>
        
        
        <category>Technology</category>
        
        <category>SharePoint</category>
        
      </item>
    
      <item>
        <title>Use A Records for SharePoint Sites When Using Kerberos</title>
        <description>&lt;p&gt;When given the choice between using an A DNS record or a CNAME DNS record for your SharePoint web applications, favor an A record particularly if you are using Kerberos authentication.&amp;#160; Reference the following TechNet article:&lt;/p&gt;
&lt;p&gt;&lt;a title=&quot;http://technet.microsoft.com/en-us/library/gg502606.aspx&quot; href=&quot;http://technet.microsoft.com/en-us/library/gg502606.aspx&quot;&gt;http://technet.microsoft.com/en-us/library/gg502606.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Of particular interest in this article is the following passage:&lt;/p&gt;
&lt;blockquote&gt;&lt;h6&gt;Kerberos authentication and DNS CNAMEs&lt;/h6&gt;
&lt;p&gt;There is a known issue with some Kerberos clients (Internet Explorer 7 and 8 included) that attempt to authenticate with Kerberos enabled services that are configured to resolve using DNS CNAMEs instead of A Records. The root of the problem is the client does not correctly form the SPN in the TGS request by creating it using the host name (A Record) instead of the alias name (CNAME). &lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;A Record: wfe01.contoso.com&lt;/p&gt;
&lt;p&gt;CNAME: intranet.contoso.com (aliases wfe01.contoso.com)&lt;/p&gt;
&lt;p&gt;If the client attempts to authenticate with http://intranet.contoso.com, the client does not correctly form the SPN and requests a Kerberos ticket for http/wfe01.contoso.com instead of http/intranet.contoso.com &lt;/p&gt;
&lt;p&gt;Details regarding the issue can be found in the following articles:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://support.microsoft.com/kb/911149/en-us&quot;&gt;http://support.microsoft.com/kb/911149/en-us&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://support.microsoft.com/kb/938305/en-us&quot;&gt;http://support.microsoft.com/kb/938305/en-us&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To work around this issue, configure Kerberos enabled services using DNS A records instead of CNAME aliases. The hotfix mentioned in KB article will correct this issue for Internet Explorer but will not correct the issue for the .NET framework (which is used by Microsoft Office SharePoint Server for web service communication).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;What me and my team experienced is that a customer had a customization which interfaced with Exchange.&amp;#160; The browser authentication to the web application appeared to be working fine, but the double-hop to Exchange was failing with a 401 error.&amp;#160; All SPNs appeared to be correct.&amp;#160; We changed the DNS records from CNAME records to A records and the authentication began to work as expected.&lt;/p&gt;
</description>
        <pubDate>Wed, 13 Jul 2011 01:53:46 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/07/13/use-a-records-for-sharepoint-sites-when-using-kerberos/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/07/13/use-a-records-for-sharepoint-sites-when-using-kerberos/</guid>
        
        <category>kerberos</category>
        
        <category>SharePoint</category>
        
        
        <category>SharePoint</category>
        
      </item>
    
      <item>
        <title>Couple &amp;quot;Gotchas&amp;quot; with Console Applications and SharePoint 2010</title>
        <description>&lt;p&gt;Wrote a console application today that synchronizes a SQL database with task information from a SharePoint farm as part of a task aggregation solution for a client.  Came across two small &quot;issues&quot; with Visual Studio 2010/SharePoint 2010 and console applications.  I am primarily writing this to remind myself later, but perhaps it will help someone else as well.&lt;/p&gt;
&lt;p&gt;First &quot;gotcha&quot;:  Make sure you set the target .NET Framework to 3.5.  By default Visual Studio 2010 is going to select 4.0 and it will then do a bunch of complaining about not finding Microsoft.SharePoint.dll.  Yes, the compiler will give a pretty detailed error which may or may not reference the fact that you need to target 3.5, but it had me scratching my head for awhile so I figure its worth capturing.&lt;/p&gt;
&lt;p&gt;Second &quot;gotcha&quot;:  You need to target x64 platform.  I was getting all kinds of crazy behavior when targeting x86.  When I would try to create SPSite objects I would get &quot;FileNotFound&quot;.  If I would try to use SPWebService.Locate I would get permissions issues.  Switch the platform to x64 and everything started working like magic!&lt;/p&gt;
&lt;p&gt;That's it, hope this saves someone some time (preferably me on a later project ;-) ).&lt;/p&gt;
</description>
        <pubDate>Wed, 13 Jul 2011 01:32:13 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/07/13/couple-gotchas-with-console-applications-and-sharepoint-2010/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/07/13/couple-gotchas-with-console-applications-and-sharepoint-2010/</guid>
        
        <category>SharePoint</category>
        
        
        <category>Programming</category>
        
        <category>SharePoint</category>
        
        <category>Software Development</category>
        
      </item>
    
      <item>
        <title>Programmatically Changing the Show and Hide Ribbon Navigation Setting</title>
        <description>&lt;p&gt;Much like everything I blog about, I had a requirement from a customer to programmatically set the &quot;Show and Hide Ribbon&quot; setting that is seen within the Navigation configuration page off of Site Settings (a.k.a. the _layouts/AreaNavigationSettings.aspx page).  I looked all through the SPWeb.Navigation options and the PublishingWeb.Navigation options and couldn't find it.  Then I remembered the oldest trick in the book, decompiling SharePoint!  I brought up the Microsoft.SharePoint.Publishing.dll in &lt;a href=&quot;http://www.telerik.com/products/decompiling.aspx&quot;&gt;Telerik JustDecompile&lt;/a&gt; and found the codebehind implementation for the page.  Once there it was easy to figure out how to make the change.  Fast-forward, here it is:&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c#&quot; data-lang=&quot;c#&quot;&gt;&lt;span class=&quot;n&quot;&gt;SPWeb&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;web&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// works better if you actually set this to a valid instance&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// so this property, the __DisplayShowHideRibbonActionId, doesn't exist unless it's set to No!&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// so in this instance we are setting it to No, but if you want to set it to Yes you just&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// want to clear the value for the property.  make it string.Empty, or just delete the&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// property entirely.&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AllProperties&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;__DisplayShowHideRibbonActionId&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;False&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Update your web, do a jig.&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 16 Jun 2011 02:19:45 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/06/16/changing-the-show-enabled/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/06/16/changing-the-show-enabled/</guid>
        
        <category>SharePoint</category>
        
        
        <category>Programming</category>
        
        <category>SharePoint</category>
        
      </item>
    
      <item>
        <title>Programmatically Add ListViewWebPart with Customized View</title>
        <description>&lt;p&gt;There are several approaches to adding a ListViewWebPart to a page floating around the Interwebs, and I do believe over the course of the past week I have tried every one of them!  What I intend to do here is to cut to the chase and present the method that worked reliably for my purposes.&lt;/p&gt;
&lt;h3&gt;Scenario&lt;/h3&gt;
&lt;p&gt;As the title suggests, the scenario is that we are adding a ListViewWebPart to a page, utilizing one of the current list views as a &quot;template&quot;, but making some changes for the purposes of this web part.&lt;/p&gt;
&lt;h3&gt;Solution&lt;/h3&gt;
&lt;p&gt;I recommend hitting the &quot;view source&quot; button on the syntax highlighter, I really need to switch to a wider blog template :-(.  In any event, here is the solution that I employed, I added numerous comments to describe why things were being done.  Hopefully it saves someone some time.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c#&quot; data-lang=&quot;c#&quot;&gt;&lt;span class=&quot;n&quot;&gt;SPLimitedWebPartManager&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;limitedWebPartManager&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;ListViewWebPart&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;wp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// assume that you have a limitedWebPartManager variable containing an&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// instance of a SPLimitedWebPartManager class.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// also assume that you have a list variable containing a reference to the&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// SPList that you are pointing this ListViewWebPart at.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// create an instance of the ListViewWebPart&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;wp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ListViewWebPart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// convert the list GUID to a string, must include braces (ToString(&quot;B&quot;)) and be in uppers (ToUpper())&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;wp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ListName&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;B&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ToUpper&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// optionally set the title of the web part&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;wp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;I Love List Views&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// add the web part to the limited web part manager.  when you do this, a &quot;hidden&quot; view will be created&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// on the list referenced by the list variable.  we will later get a reference to this hidden view and bend it&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// to our will.&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;limitedWebPartManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;AddWebPart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;whatever web part zone you want to add it to&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// the 1 is the index within the zone&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// you need to update the list because a view was just added to it&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// now that the web part has been added we need to get a fresh reference to it from the limitedWebPartManager.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// there are plenty of great ways to do this, in this example i will be using the low-tech approach of enumerating the&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// WebParts collection and checking for the type and title that matches our part.  i am quite positive there are more&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// efficient ways of doing this, but this code gets called exactly once every couple months, so efficiency isn't worth&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// the extra development cycles&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;foreach&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UI&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WebControls&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WebParts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WebPart&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;webPart&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;limitedWebPartManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WebParts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// check to see if the type of the web part is ListViewWebPart, and if so, check if the title matches our guy.&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;webPart&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ListViewWebPart&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;amp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;amp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;amp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;amp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;webPart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Equals&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;I Love List Views&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// cast the web part to a ListViewWebPat so we can start to tweak its properties&lt;/span&gt;
            &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;listViewWebPart&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;webPart&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ListViewWebPart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// here is some of the magic.  the web part now has its ViewGuid property populated which&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// contains the Guid of the hidden view.  we get a reference to it here.&lt;/span&gt;
            &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Views&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Guid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;listViewWebPart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ViewGuid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)];&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// here we grab a reference to a template view.  this may be the default view of the list,&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// or maybe you have another view that you created that you want to use.  you don't have to&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// do this, but in this scenario i wanted to copy the filter and sort settings from an existing view.&lt;/span&gt;
            &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;templateView&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Views&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Name Of Template View&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// now we drop all of the view fields in the hidden view&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ViewFields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;DeleteAll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// now we are going to go through a string array and add each of the strings to the view fields collection.  again,&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// you don't have to do this, but if you want to change what columns are displayed in your ListViewWebPart, you will&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// need to muck with the ViewFields of the view.&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ForEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;First Name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Last Name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Address&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ViewFields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// here we copy the Query straight from the templateView.  if you didn't have a templateView you could always&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// just create an SPQuery instance and assign it to the view.Query property.  no points will be taken off for doing that.&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Query&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;templateView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;c1&quot;&gt;// update our hidden view, and bask in the awesomeness of our customized ListViewWebPart&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;finally&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// do some fun cleanup of disposable items.  if you are wondering about the .Web.Dispose() bit look for my&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// blog article on the memory leaks in the SPLimitedWebPartManager.&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;limitedWebPartManager&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;limitedWebPartManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;limitedWebPartManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Web&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;limitedWebPartManager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;wp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// i probably missed some .Dispose()s since I cobbled this code together in Wordpress and not Visual Studio&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 16 Jun 2011 02:08:35 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/06/16/programmatically-add-listviewwebpart-with-customized-view/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/06/16/programmatically-add-listviewwebpart-with-customized-view/</guid>
        
        <category>SharePoint</category>
        
        
        <category>Programming</category>
        
        <category>SharePoint</category>
        
      </item>
    
      <item>
        <title>Tech Ed 2011 Summary</title>
        <description>&lt;p&gt;Sitting in the Atlanta airport waiting for my flight home seems as good a time as any to summarize what I learned this week at Tech Ed 2011 in Atlanta.&amp;#160; &lt;/p&gt;
&lt;p&gt;First, this is the second year in a row that I have used my iPad at Tech Ed for note taking.&amp;#160; Last year I used Apple’s Pages app to take notes, and that worked reasonably well.&amp;#160; During the keynote this year I searched for other options and came across &lt;a href=&quot;http://bit.ly/l2A9AV&quot;&gt;iThoughts HD&lt;/a&gt;.&amp;#160; This is a mind mapping app similar to &lt;a href=&quot;http://bit.ly/lg8bvT&quot;&gt;Freemind&lt;/a&gt; or &lt;a href=&quot;http://www.xmind.net/&quot;&gt;XMind&lt;/a&gt; on the PC.&amp;#160; This app worked incredibly well for me taking notes, as often the presentations would bounce back and forth between topics and the ability to simply tap on the nodes within the mind map felt very natural and productive.&amp;#160; In addition, the app allows you to export in a number of formats, two of which being Freemind and Xmind, so I will be able to send my maps to the PC and edit them in one of those programs.&amp;#160; &lt;/p&gt;
&lt;p&gt;While the iThoughts HD app was great, you could do the same thing on the PC using the previously mentioned Freemind or Xmind apps.&amp;#160; Where the iPad really shines however is the fact that you can go ALL DAY taking notes, browsing the web, tweeting, etc. without ever having to look for an electric outlet!&amp;#160; If you have been to Tech Ed, you no doubt understand how difficult it can be to find electric outlets to charge your laptop.&amp;#160; In a sea of 10,000 attendees, electric outlets are precious resources.&amp;#160; &lt;/p&gt;
&lt;p&gt;Okay, enough about how great the iPad is, on to what I actually learned!&lt;/p&gt;
&lt;h3&gt;Virtualizing SharePoint&lt;/h3&gt;
&lt;p&gt;Virtualizing SharePoint was a good session, although it didn’t necessarily provide a bevy of new information, it at least validated things I believed to be true.&amp;#160; Couple of key points:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;SharePoint and virtualization go together like peanut butter and jelly.&amp;#160; If someone tries to tell you otherwise, smack them and their momma.&amp;#160; Yes, SharePoint is resource intensive, so no, don’t build your hyper-v cluster on 386SXs.&amp;#160; Use the latest server hardware technologies available, use the latest hypervisor offerings from Microsoft and VMware, use Windows Server 2008 R2 guests, and be happy.&lt;/li&gt;
&lt;li&gt;Certain SharePoint roles are absolute slam-dunks for virtualization, other roles require further consideration.&amp;#160; Web front ends, query, and app roles are all ideal candidates for virtualization.&amp;#160; What makes something an ideal candidate for virtualization?&amp;#160; Really it comes down to how resource intense the role is.&amp;#160; In a SharePoint farm, the aforementioned roles happen to be the lighter roles within the farm.&amp;#160; This leaves your index/crawl roles and your SQL roles up for debate.&amp;#160; Whether or not you choose to virtualize your SQL servers is greatly influenced by how large/active of a farm you have, and how important the benefits of virtualization are.&amp;#160; &lt;/li&gt;
&lt;li&gt;Fixed-size VHDs and direct-attached LUNs are very close in performance.&amp;#160; Do NOT use dynamically sizing VHDs.&amp;#160; You can think about it, but DON’T DO IT.&amp;#160; Where disk performance is of utmost importance, *hem hem* SQL server *hem hem*, send the LUN straight to the VM.&amp;#160; Where it is not as critical, like in a web front end or app server role, using a fixed-size VHD gives some flexibility in terms of moving the VHD around, and the performance impact is negligible.&lt;/li&gt;
&lt;li&gt;This doesn’t apply to just virtualization scenarios, but ALWAYS, ALWAYS, ALWAYS define a SQL alias and point SharePoint at the alias, otherwise you can not move your SQL instance housing the SharePoint config database.&lt;/li&gt;
&lt;li&gt;Okay, I don’t fully get this one just yet, so I need to do more research, but apparently allocating memory that causes the VM to cross NUMA boundaries is a V.ery B.ad T.hing.&amp;#160; In simple terms I understood what was being said, take the amount of RAM of the host machine and divide it by the number of cores, and that is your NUMA window size.&amp;#160; Then multiply that size by the number of CPUs assigned to the guest and do not exceed that, but as I understand it that is an oversimplification.&amp;#160; Crossing NUMA boundaries allegedly leads to a performance hit of 30% or more.&lt;/li&gt;
&lt;li&gt;For any disk intense guests make sure the RAID configuration for the VHD or the RAID configuration for the LUN is RAID 10.&amp;#160; This ensures the greatest write performance.&lt;/li&gt;
&lt;li&gt;Reverting to VM snapshots is NOT supported by Microsoft.&lt;/li&gt;
&lt;li&gt;Combine SQL Mirroring with HyperV/Vsphere clustering and you have a robust high availability solution.&lt;/li&gt;
&lt;li&gt;Do not put your SQL guest and your web front end on the same physical host.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Cross-Farm SharePoint Services&lt;/h3&gt;
&lt;p&gt;This session was really heavy on the PowerShell needed to implement cross-farm services, which I didn’t find to be tremendously useful.&amp;#160; The PowerShell was not up long enough for someone to transcribe it, and you are not going to commit it to memory in the short amount of time it is being displayed, so I would have preferred more discussion around the concepts and techniques being used instead of just showing code.&amp;#160; In any event, I did pickup a few things from this session:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Cross-farm shared services are synonymous with federated services.&lt;/li&gt;
&lt;li&gt;Cross-farm shared services can be in different domains.&amp;#160; &lt;/li&gt;
&lt;li&gt;Writing PowerShell scripts to create/configure your farms makes for better disaster recovery documentation than “click here, click here” documentation.&lt;/li&gt;
&lt;li&gt;Cross-farm shared services are not compatible with Office 365.&lt;/li&gt;
&lt;li&gt;The load balancer that SharePoint has out-of-the-box for service applications does simple round robin load balancing, it does not perform health checks of the services.&lt;/li&gt;
&lt;li&gt;Regardless of the authentication type for the web application, behind the scenes SharePoint is using claims authentication.&lt;/li&gt;
&lt;li&gt;When troubleshooting issues with federated services, ensure that the consumer has permissions to the Topology Service.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Building IT Dashboards with Visio Services&lt;/h3&gt;
&lt;p&gt;Picked up a few tidbits here; I hadn’t previously seen any demos of Visio Services or had an opportunity to play with it myself, so just seeing it being used was interesting.&amp;#160; Here are the highlights:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Visio Data Graphics allow you to overlay shapes with an icon based on a rule.&amp;#160; Think Excel Conditional Formatting rules.&amp;#160; Very cool.&lt;/li&gt;
&lt;li&gt;When you save your Visio Diagram, make sure to save as a “Web Drawing”&lt;/li&gt;
&lt;li&gt;Visio Services provides a “read-only” view of the diagram.&lt;/li&gt;
&lt;li&gt;Visio Services renders using a Silverlight web part, but can degrade to a raster form of the diagram if Silverlight is not available on the client.&lt;/li&gt;
&lt;li&gt;Visio Services can use the following data sources:&amp;#160; Excel Services, SQL, OLE DB, ODBC, Custom, SharePoint List.&amp;#160; It cannot use External Lists/BCS or Analysis Services.&lt;/li&gt;
&lt;li&gt;Visio Services is a component of the SharePoint Enterprise SKU.&lt;/li&gt;
&lt;li&gt;Visio 2010 Premium contains a SharePoint Workflow template.&lt;/li&gt;
&lt;li&gt;You can use web part connections to connect a Visio Diagram to an InfoPath Form web part as an example.&amp;#160; If you want to connect multiple data columns you need to use SharePoint Designer as the web interface only allows you to connect a single data field between the two web parts.&lt;/li&gt;
&lt;li&gt;Visio Web Services ships with an extensive JavaScript library.&amp;#160; It is preferable to use this library to connect web parts as opposed to using web part connections because web part connections cause post backs.&lt;/li&gt;
&lt;li&gt;When defining a workflow in SharePoint Designer, if you select “Show Workflow Visualization on Status Page” check box, SharePoint will render a Visio Services view of the workflow and overlay the status of each workflow action.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;SharePoint and Silverlight&lt;/h3&gt;
&lt;p&gt;The SharePoint and Silverlig&lt;br /&gt;
ht session was very code heavy, which wasn’t incredibly valuable to me.&amp;#160; Not that I have anything against code, obviously I do not, but I wasn’t going to be committing to memory hundreds of lines of code over a 1.5 hour period.&amp;#160; Still, I was able to pick up on some key concepts which made the session worthwhile.&amp;#160; First, the session validated my belief that Silverlight would prove to be a great technology moving forward with SharePoint as SharePoint portals become more and more locked down.&amp;#160; In other words, instead of deploying customizations that are server side, many client requirements can be handled through JavaScript or Silverlight and not require either sandbox solutions or farm solutions.&amp;#160; Here are a couple of key points I heard:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Search for and install the Silverlight SharePoint extensions for Visual Studio.&amp;#160; They make it simple to incorporate your Silverlight into a SharePoint page for development.&lt;/li&gt;
&lt;li&gt;Silverlight has a technology called HTML bridging which allows the Silverlight application to modify HTML within the hosting page.&amp;#160; This was demonstrated by defining a ‘div’ on a page and then clicking a shape in the Silverlight app which subsequently added text to the div.&amp;#160; Pretty cool.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.data.services.client.dataservicequery.aspx&quot;&gt;DataServiceQuery&lt;/a&gt; class can/should be used to query SharePoint OData services.&lt;/li&gt;
&lt;li&gt;Silverlight is able to take advantage of the rich SharePoint 2010 client object model, including the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.webparts.limitedwebpartmanager.aspx&quot;&gt;LimitedWebPartManager&lt;/a&gt; class.&lt;/li&gt;
&lt;li&gt;There is an issue with older ASMX web services which causes them to be incompatible with Silverlight.&amp;#160; As a workaround, a endpoint behavior has been developed and open sourced that will adapt the data types from the legacy ASMX web service to the data types expected by Silverlight.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Writing SharePoint Service Applications&lt;/h3&gt;
&lt;p&gt;This was another session that was really deep on implementation code.&amp;#160; I’m sorry, but I lose interest pretty quick in a session like this; really the slide deck becomes more important than what the speaker is saying.&amp;#160; It was useful though to get a feeling for the complexity level of writing a SharePoint custom service application.&amp;#160; Simply put – it’s a very high complexity level!&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In most instances, write a web service, not a service application.&lt;/li&gt;
&lt;li&gt;Write a service application when you want a unified management interface through Central Administration, want to take advantage of SharePoint’s backup and recovery features, want to take advantage of SharePoint’s round-robin load balancing.&lt;/li&gt;
&lt;li&gt;Creating a service application involves implementing a minimum of 5 classes.&amp;#160; Best to just go here &lt;a title=&quot;http://bit.ly/giiGhb&quot; href=&quot;http://bit.ly/giiGhb&quot;&gt;http://bit.ly/giiGhb&lt;/a&gt; and read up on it.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;NuGet in the Enterprise&lt;/h3&gt;
&lt;p&gt;I’ve seen &lt;a href=&quot;http://nuget.codeplex.com/&quot;&gt;NuGet&lt;/a&gt; popping up everywhere lately, and was very interested in this session to learn more about its applications in an enterprise environment.&amp;#160; If you are not familiar with NuGet, read up here &lt;a title=&quot;http://bit.ly/mqgRvV&quot; href=&quot;http://bit.ly/mqgRvV&quot;&gt;http://bit.ly/mqgRvV&lt;/a&gt;.&amp;#160; In a nutshell, NuGet facilitates incorporating dependencies into your projects.&amp;#160; If you know anything about Java, think Maven repo.&amp;#160; Where it is different however is that it is not involved in your build like Maven is, but it does make it simpler to incorporate dependencies into your project and to upgrade dependencies within your projects.&lt;/p&gt;
&lt;p&gt;Okay, so how about the “Enterprise” part?&amp;#160; What is great about NuGet is that while it is perfectly viable for you to go out and install packages from the public NuGet gallery, in most enterprise development scenarios you will want to have more control over what packages are being incorporated into projects.&amp;#160; NuGet provides the ability to stand up an enterprise NuGet server, either as just a simple “head-less” server or a rich, &lt;a href=&quot;http://www.orchardproject.net/&quot;&gt;Orchard&lt;/a&gt;-driven gallery.&amp;#160; With this you can provide the ability to browse the NuGet gallery through a rich web interface.&lt;/p&gt;
&lt;p&gt;It is important to note that while there is a NuGet Visual Studio extension, NuGet works perfectly well on a clean build server, and &lt;a href=&quot;http://www.jetbrains.com/&quot;&gt;Jetbrains&lt;/a&gt; is working to incorporate the ability to integrate NuGet into &lt;a href=&quot;http://www.jetbrains.com/teamcity/&quot;&gt;TeamCity&lt;/a&gt;.&amp;#160; This is great news as many organizations will want the ability to build dependency packages within TeamCity and then publish those packages to the enterprise NuGet server.&amp;#160; You can accomplish this today using the command-line in your build definitions, but making TeamCity NuGet aware will facilitate integration quite a bit.&lt;/p&gt;
&lt;p&gt;NuGet = good.&amp;#160; I will definitely be adding setting up a NuGet server to my list of things to do at the office.&lt;/p&gt;
&lt;h3&gt;Claims Identity and SharePoint&lt;/h3&gt;
&lt;p&gt;I will freely admit that I had next to no knowledge of Claims-based Authentication coming into this session.&amp;#160; I knew it was a radio-button I could select when provisioning a web application, and I knew that I didn’t want to use it, instead I wanted classic authentication.&amp;#160; That should have been my first clue that I had some homework to do.&amp;#160; Career tip – If you are presented with two options, one saying “classic” and one saying something else, learn what that other option means or risk extinction!&amp;#160; Classic cars are cool, classic* in technology is un-cool.&amp;#160; &lt;/p&gt;
&lt;p&gt;There was a great analogy shared during this session with regard to what “claims-based” authentication means.&amp;#160; The presenter, and I apologize I didn’t take notes on who the presenter was, but in any event, the presenter said that on his Facebook page his hometown is listed as Chicago.&amp;#160; Now, he actually lives outside of Chicago in a suburb.&amp;#160; The fact this his Facebook page says his hometown is Chicago does not give him the ability to vote in Chicago elections because the Chicago board of elections does not trust Facebook as a claims provider.&amp;#160; Instead, the board of elections trusts the motor vehicle administration, and his driver’s license has his actual home address.&amp;#160; &lt;/p&gt;
&lt;p&gt;What this analogy means is essentially you can setup SharePoint to trust the claims of other providers, whether they be consumer identity providers like Google or Live, external partners, etc.&amp;#160; Very powerful stuff which could definitely impact the way that extranets are architected and implemented.&lt;/p&gt;
&lt;p&gt;Couple of key bullets:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Claims are SAML-based.&amp;#160; While Active Directory Federation Services are likely to be the most common claims identity providers, any identity provider issuing a SAML-based claim is compatible.&lt;/li&gt;
&lt;li&gt;Claims authentication is based on Windows Identity Foundation.&lt;/li&gt;
&lt;li&gt;Additional information about claims authentication in general is available here &lt;a title=&quot;http://bit.ly/3G30GP&quot; href=&quot;http://bit.ly/3G30GP&quot;&gt;http://bit.ly/3G30GP&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;SharePoint 2010 allows multiple authentication methods to be defined for a single zone.&lt;/li&gt;
&lt;li&gt;Trusted identity token issuer is added through PowerShell (most claims authentication management is done through PowerShell)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bit.ly/iU139G&quot;&gt;SelfSTS&lt;/a&gt; is a utility that makes it easy to develop/debug claims authentication.&lt;/li&gt;
&lt;li&gt;SharePoint does not use the operating systems certificate store.&amp;#160; Certificates that are loaded into SharePoint are actually stored in SQL so that they apply farm-wide.&lt;/li&gt;
&lt;li&gt;Claims authentication impacts the behavior of the people picker.&amp;#160; Essentially, SharePoint does not know who is on the other side of the fence providing claims.&amp;#160; So if you wanted to say “Johnny Appleseed” from “ABC Corp” can&lt;br /&gt;
 access a given site, you would say in the people picker, “Any claim coming in where the e-mail address is &lt;a href=&quot;mailto:jappleseed@abcorp.com&quot;&gt;jappleseed@abcorp.com&lt;/a&gt; can access”.&amp;#160; You cannot validate that &lt;a href=&quot;mailto:&amp;ldquo;jappleseed@abccorp.com&quot;&gt;“jappleseed@abccorp.com&lt;/a&gt;” is the correct e-mail address.&amp;#160; It is possible that through setting up a user profile crawl of an external LDAP server you may be able to get around this.&amp;#160; Need to do some research on that.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Automating Business Processes Using SharePoint, InfoPath Forms Services, and Word Services&lt;/h3&gt;
&lt;p&gt;This will likely not come as a surprise to many, but in my experience people are really embracing SharePoint for business process automation.&amp;#160; This isn’t necessary one of the features that I see widely touted about SharePoint, but InfoPath Forms Services and SharePoint’s out of box workflow support just begs for business process automation.&amp;#160; Gone are the days of writing departmental ASP.NET web apps for anything and everything (sniff, sniff).&amp;#160; This session had some great best practices for automating business processes in SharePoint.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;As mentioned previously, this session also really pushed using sandbox solutions and the client-side object model.&amp;#160; With Silverlight and JQuery we can finally truly push presentation out to the browser and not have this mix-match of services and presentation on the server.&amp;#160; Several sessions all highly recommended sandbox solutions, and to target solutions for Office365 compatibility regardless of whether or not you are actually deploying to the cloud.&amp;#160; This will ensure the least painful (read costly) upgrades and maintenance.&lt;/li&gt;
&lt;li&gt;Follow application lifecycle management even for out-of-the-box SharePoint business process automation.&amp;#160; What does this mean?&amp;#160; It means defining your process before implementing it.&amp;#160; Implementing the process in a non-production environment before moving to production.&amp;#160; Considering versioning impact on the process.&lt;/li&gt;
&lt;li&gt;I wholeheartedly agree with this one – when using business connectivity services, never connect directly to a SQL database.&amp;#160; Implement a web service and connect BCS to the web service.&amp;#160; This gives you the ability to enforce any business rules that may be required if write is enabled through BCS, logging, abstraction of the data layer incase things move around, etc.&amp;#160; Preferably you already have a service layer in front of the SQL database and can simply connect to that, but if you do not, go ahead and write one!&lt;/li&gt;
&lt;li&gt;Never use “Revert to self” authentication for BCS.&amp;#160; Revert to self uses the application pool identity of the web application to authenticate to the backend service.&amp;#160; It is much more secure to use passthrough authentication (the callers identity passes through to the backend system) or use secure store service to map the user to a credential for the backend system.&lt;/li&gt;
&lt;li&gt;Stay away from external list lookup columns.&amp;#160; If you implement these the data gets cached and whatever data the user who created the lookup column had rights to gets presented to everyone.&amp;#160; In other words, if Joe creates the lookup column and he has access to all rows in the table, but Ben is supposed to only see half of the rows, Ben will end up seeing all rows in the lookup column.&amp;#160; One workaround for this is to use InfoPath forms and use a secondary data connection to populate a drop-down instead of using a lookup column type.&lt;/li&gt;
&lt;li&gt;I didn’t realize there is an OpenXML SDK that can be used to generate a class for writing Word documents (&lt;a title=&quot;http://bit.ly/iYPgEg&quot; href=&quot;http://bit.ly/iYPgEg&quot;&gt;http://bit.ly/iYPgEg&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;As with other customizations in SharePoint, workflows should first be done using out of the box features.&amp;#160; If out of the box features cannot meet the business requirements then reusable custom activities should be employed.&amp;#160; As an absolute last resort create a custom workflow in Visual Studio.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Cross Organization Collaboration Using SharePoint Claims Authentication&lt;/h3&gt;
&lt;p&gt;Whew, this post is running a lot longer than I was expecting!&amp;#160; Must ….&amp;#160; Keep …. Typing!&amp;#160; &lt;/p&gt;
&lt;p&gt;Anyway, this session was pretty similar to the earlier session on setting up claims authentication, but there were a few tidbits I picked up that weren’t in the other session:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Office 2010 applications fully support claims-based authentication.&amp;#160; Office 2007 applications have some “gotchas”.&amp;#160; What those “gotchas” are were not explained, so I’ll have to do some research on this.&lt;/li&gt;
&lt;li&gt;Claims authentication enables SharePoint to use “consumer” ids like Facebook, Google, Live, etc.&amp;#160; The best practice when using consumer ids is to create a local unique identifier for the account and map the identifier to the consumer id.&amp;#160; This provides some flexibility in terms of being able to switch the consumer ID that is used for an account without it changing the underlying profile.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;SQL Server “Denali” Reporting Improvements&lt;/h3&gt;
&lt;p&gt;So, &lt;a href=&quot;http://bit.ly/c5lxNy&quot;&gt;SQL Server “Denali”&lt;/a&gt; will be coming out soon as a CTP, and man oh man, after seeing the improvements being made to reporting services and its SharePoint integration, I cannot wait!&amp;#160; Here are some of the highlights I heard:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Native SharePoint service application integration.&amp;#160; No more bubblegum and duct tape integration, reporting services will be a first class SharePoint service application.&amp;#160; Microsoft is indicating performance improvements of 30-60% over SQL Server 2008 R2 SharePoint integrated mode.&amp;#160; In addition, configuration will be managed through Central Administration and logging will be through ULS.&lt;/li&gt;
&lt;li&gt;Self-service alerting.&amp;#160; Users will be able to setup alerts based on data contained in reports.&amp;#160; Very cool stuff.&lt;/li&gt;
&lt;li&gt;Ability to export as Open XML file formats.&amp;#160; Still no PowerPoint support, but a step in the right direction.&lt;/li&gt;
&lt;li&gt;One of the coolest things I saw was &lt;a href=&quot;http://bit.ly/cVf0aH&quot;&gt;“Project Crescent”&lt;/a&gt;.&amp;#160; Think Report Builder meets Silverlight.&amp;#160; The intention is to enable end users to create their own reports right in the SharePoint portal using a Silverlight client and SQL Server Analysis Services integration.&amp;#160; The demo was incredibly impressive, can’t wait to kick the tires when the CTP comes out.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Alright, this is the part of the program where I start to get lazy &lt;img style=&quot;border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none&quot; class=&quot;wlEmoticon wlEmoticon-smile&quot; alt=&quot;Smile&quot; src=&quot;http://localhost:31663/wp-content/uploads/2011/05/wlEmoticon-smile.png&quot; /&gt;.&amp;#160; I attended another 5 sessions, but each of the sessions did not really have enough for me to start a whole new section here.&amp;#160; So, here is what I propose.&amp;#160; I’m just going to bullet out the couple random things picked up from each session in one list.&amp;#160; It’s not all that much, so it should be fairly easy to follow.&amp;#160; Let’s give it a try, and see what happens, shall we?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;MVC 3 supports HTML5 markup.&lt;/li&gt;
&lt;li&gt;With MvcScaffolding you can add your validation rules to your POCO classes and the scaffolding will generate the appropriate DB and web validation.&lt;/li&gt;
&lt;li&gt;Entity Framework 4.1 supports code first!&amp;#160; Hooray!&lt;/li&gt;
&lt;li&gt;Web forms is getting into the scaffolding scene also.&amp;#160; WebFormsScaffolding.&amp;#160; Does anyone still care about web forms?&amp;#160; Please Microsoft, next rev of SharePoint kick web forms to the curb so we can all put web forms out to pasture and wash the stink from ourselves.&lt;/li&gt;
&lt;li&gt;IISExpress enables you to have a nice lightweight usermode IIS that supports SSL.&lt;/li&gt;
&lt;li&gt;You &lt;u&gt;can&lt;/u&gt; do HTML5 in SharePoint!&amp;#160; Make sure to remove the “meta” tag that says IE-Compat-8.&amp;#160; Just get rid of it. &lt;/li&gt;
&lt;li&gt;Couple ways of loading jQuery into ShareP&lt;br /&gt;
oint:&amp;#160; Script link, Sys.loadScripts, Custom Action ScriptLink.&lt;/li&gt;
&lt;li&gt;Wasn’t aware of the following JavaScript function: _spBodyOnLoadFunctionNames.push() allows you to put something into the body onLoad from a content editor web part.&lt;/li&gt;
&lt;li&gt;Couple other cool bits of JavaScript:&amp;#160; SP.UI.Notify and SP.UI.Status give you the ability to do the cool yellow notifications or red status alerts in SharePoint.&amp;#160; SP.UI.ModalDialog is used to pop up a modal (duh).&lt;/li&gt;
&lt;li&gt;Wasn’t aware of Randy Drisgill’s starter master page for 2010:&amp;#160; &lt;a title=&quot;http://bit.ly/cfuPTK&quot; href=&quot;http://bit.ly/cfuPTK&quot;&gt;http://bit.ly/cfuPTK&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Holy cow, I actually do not have any more notes!&amp;#160; So that was basically my week at TechEd.&amp;#160; I also worked in the 70-667 (SharePoint 2010 Configuration) exam and some time in the Exhibit Hall talking to various SharePoint component vendors.&amp;#160; Lots and lots of follow-on research to do, can’t wait!&lt;/p&gt;
</description>
        <pubDate>Fri, 20 May 2011 20:32:43 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/05/20/tech-ed-2011-summary/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/05/20/tech-ed-2011-summary/</guid>
        
        <category>denali</category>
        
        <category>nuget</category>
        
        <category>SharePoint</category>
        
        <category>teched</category>
        
        
        <category>SharePoint</category>
        
        <category>Software Development</category>
        
      </item>
    
      <item>
        <title>Troubleshooting TCP/UDP connectivity</title>
        <description>&lt;p&gt;I have spent the past several weeks installing, configuring, and mainly troubleshooting an OCS 2007 R2 instance.  One of the issues that we were facing is that we could place EV calls from within our network, but calls from outside the network (coming through the edge) would fail.  Basically the call would be placed, but as soon as the opposite end answered the call would disconnect.&lt;/p&gt;
&lt;p&gt;In any event, those details are not really why I am posting this.  What I ran into is that there are several network segments and firewall rules between the client, the edge, the mediation server, the front-end, etc.  While we all know how to troubleshoot TCP connectivity issues easy enough using telnet, I was struggling to troubleshoot UDP connectivity, specifically for the STUN protocol (UDP port 3478).  I came across the following utility that was infinitely helpful in determining the issue:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.pcausa.com/Utilities/pcattcp.htm&quot;&gt;http://www.pcausa.com/Utilities/pcattcp.htm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This utility allows you to setup a transmitting and receiving pair, it's a tiny executable, and it has no discernible external DLL requirements.  I highly recommend adding it to your toolbox!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.pcausa.com/Utilities/pcattcp.htm&quot;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 18 Feb 2011 17:17:59 +0000</pubDate>
        <link>http://ofonesandzeros.com/2011/02/18/troubleshooting-tcpudp-connectivity/</link>
        <guid isPermaLink="true">http://ofonesandzeros.com/2011/02/18/troubleshooting-tcpudp-connectivity/</guid>
        
        <category>network</category>
        
        <category>ocs</category>
        
        <category>troubleshooting</category>
        
        
        <category>Windows</category>
        
      </item>
    
  </channel>
</rss>
