<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>SharePoint Stef (@vanHooijdonk)</title>
	<atom:link href="http://stefvanhooijdonk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefvanhooijdonk.com</link>
	<description>my blog on SP2010 and related subjects.</description>
	<lastBuildDate>Fri, 03 Sep 2010 08:30:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SharePoint 2010 August Cumulative Update</title>
		<link>http://stefvanhooijdonk.com/2010/09/02/sharepoint-2010-august-cumulative-update/</link>
		<comments>http://stefvanhooijdonk.com/2010/09/02/sharepoint-2010-august-cumulative-update/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 07:18:53 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=851</guid>
		<description><![CDATA[Microsoft just released the SharePoint Foundation Cumulative Update for August 2010. SharePoint Foundation 2010: kb2266423 &#8211; Download SharePoint Server 2010: kb2352342 (not live yet) &#8211; Download (Updated to point the urls to the correct hotfixes) via: http://blogs.msdn.com/b/aaronsaikovski http://blogs.technet.com/b/stefan_gossner]]></description>
			<content:encoded><![CDATA[<p>Microsoft just released the SharePoint Foundation Cumulative Update for August 2010.</p>
<p>SharePoint Foundation 2010:<br />
<a href="http://support.microsoft.com/kb/2266423" target="_blank">kb2266423</a> &#8211; <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2266423&#038;kbln=en-us" target="_blank">Download</a></p>
<p>SharePoint Server 2010:<br />
<a href="http://support.microsoft.com/kb/2352342" target="_blank">kb2352342</a> (not live yet) &#8211; <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbln=en-us&#038;kbnum=2352342" target="_blank">Download</a></p>
<p>(Updated to point the urls to the correct hotfixes)</p>
<p>via:<br />
<a href="http://blogs.msdn.com/b/aaronsaikovski/archive/2010/09/02/sharepoint-2010-august-2010-cumulative-updates-are-now-ready-for-download.aspx" target="_blank">http://blogs.msdn.com/b/aaronsaikovski</a><br />
<a href="http://blogs.technet.com/b/stefan_gossner/archive/2010/09/02/august-2010-cumulative-update-for-sharepoint-has-been-released.aspx" target="_blank">http://blogs.technet.com/b/stefan_gossner</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/09/02/sharepoint-2010-august-cumulative-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Federated Search and Twitter</title>
		<link>http://stefvanhooijdonk.com/2010/08/31/federated-search-and-twitter/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/31/federated-search-and-twitter/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 15:27:50 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Search]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=840</guid>
		<description><![CDATA[So was trying some federated search the other day, and ended up with a Twitter Federated Search Location. Download the zipped Twitter.OSDX and add it to your Federated Search Locations and enjoy searching in twitter! ( I presume you know how to add a Federated Search Results Webpart to your Search Center ).]]></description>
			<content:encoded><![CDATA[<p>So was trying some federated search the other day, and ended up with a Twitter Federated Search Location.</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/sp2010-twitter-federated-searchpng.png" target="_blank"><img src="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/sp2010-twitter-federated-searchpng-300x188.png" alt="" title="sp2010-twitter-federated-searchpng" width="300" height="188" class="alignnone size-medium wp-image-841" /></a></p>
<p>Download the zipped <a href='http://stefvanhooijdonk.com/wp-content/uploads/2010/08/Twitter.zip' target="_blank">Twitter.OSDX</a> and add it to your Federated Search Locations and enjoy searching in twitter! ( I presume you know how to add a Federated Search Results Webpart to your Search Center ).</p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/31/federated-search-and-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing your own Trusted Identity provider for SP2010 (2)</title>
		<link>http://stefvanhooijdonk.com/2010/08/31/writing-your-own-trusted-identity-provider-for-sp2010-2/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/31/writing-your-own-trusted-identity-provider-for-sp2010-2/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 08:54:54 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Claims]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=723</guid>
		<description><![CDATA[This is part two of a Multi Blog post on &#8220;writing your own Trusted Identity provider / Claim Provider for SP2010&#8220;. In the first post I covered: Create a Custom Security Token Service with the Windows Identity Framework SDK In this post I will cover: Create a Custom SPClaimProvider Register your Custom SPClaimProvider Create a [...]]]></description>
			<content:encoded><![CDATA[<p>This is part two of a Multi Blog post on &#8220;<a href="http://stefvanhooijdonk.com/2010/08/19/writing-your-own-trusted-identity-provider-for-sp2010-1">writing your own Trusted Identity provider / Claim Provider for SP2010</a>&#8220;.<br />
In the first <a href="http://stefvanhooijdonk.com/2010/08/19/writing-your-own-trusted-identity-provider-for-sp2010-1">post</a> I covered:</p>
<ul>
<li>Create a Custom <a href="http://msdn.microsoft.com/en-us/magazine/dd347547.aspx" target="_blank">Security Token Service</a> with the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&amp;displaylang=en" target="_blank">Windows Identity Framework SDK</a></li>
</ul>
<p>In this post I will cover:</p>
<ul>
<li>Create a Custom <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimprovider.aspx" target="_blank">SPClaimProvider</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimproviderfeaturereceiver.aspx" target="_blank">Register</a> your Custom SPClaimProvider</li>
</ul>
<h3>Create a Custom SPClaimProvider</h3>
<p>For SharePoint 2010 to Trust any Identity Provider, we need a <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimprovider.aspx" target="_blank">SPClaimProvider</a> specific for that provider. This SPClaimProvider has two main purposes:</p>
<ul>
<li>Provide a way for SharePoint to communicate with any Trusted Identity Provider in a uniform (Interface) way.</li>
<li>And provide SharePoint a way to use the same Claims for Users that have logged in through a different (e.g. AD) Identity Provider, let&#8217;s call this Claims Augmentation</li>
</ul>
<p>To create a SPClaimProvider follow the following steps:</p>
<ul>
<li>Create a new VS2010 Empty SP2010 Project</li>
<li>And add references to <em>Microsoft.IdentityModel</em>, <em>Microsoft.SharePoint</em> and <em>Microsoft.SharePoint.Security</em>.
</li>
<li>Create a new Class, let&#8217;s name it CustomClaimsProvider and inherit from:<em>Microsoft.SharePoint.Administration.Claims.SPClaimProvider</em></li>
<li>Implement all the methods for resolving claims, this is so we can use the claims provided within SharePoint to give rights to claims:
<ul>
<li>FillHierarchy</li>
<li>FillResolve</li>
<li>FillSearch, FillSchema</li>
<li>FillClaimTypes,FillClaimValueTypes,FillEntityTypes</li>
</ul>
</li>
<li>Implement <em>GetClaimsForEntity</em> for the claims augmentation</li>
<li>Override the <em>SupportsEntityInformation</em>,<em><em>SupportsHierarchy</em>,</em>,<em>SupportsResolve</em> and <em>SupportsSearch</em> properties and let them &#8220;return True&#8221; since we have implemented all the Fill Methods for this SPClaimProvider</li>
<li>Give your Provider a <em>Name</em> by overriding the Property Name. You will need this later on.</li>
</ul>
<p>In fairness, this <a href="http://blogs.technet.com/b/speschka/archive/2010/03/13/writing-a-custom-claims-provider-for-sharepoint-2010-part-1.aspx" target="_blank">post</a> has an excellent description on the subject also.<br />
Sample implementation of FillClaimsForEntity</p>
<pre class="brush:c#">
/// &lt;summary&gt;
/// Get's the username part of a claims authentication login claim
/// figure out who the user is so we know what team to add to their claim
/// the entity.Value from the input parameter contains the name of the
/// authenticated user.  for a SQL FBA user, it looks something like
/// 0#.f|sqlmembership|user1; for a Windows claims user it looks something
/// 0#.w|steve\\wilmaf
/// 0#.t|Customsleden|stef@tamtam.nl
/// &lt;/summary&gt;
/// &lt;param name="identityClaims"&gt;&lt;/param&gt;
/// &lt;returns&gt;only the login part&lt;/returns&gt;
public static string GetLoginPartFromIdentityClaim(string identityClaims) {
    string login = identityClaims;
    if (!string.IsNullOrEmpty(login) &#038;&#038; login.Contains("|")) {
        string[] parts = login.Split('|');
        if (parts.GetLength(0) == 3) // formsbased or trusted provider based
            login = parts[2];
        if (parts.GetLength(0) == 2) // windows based
            login = parts[1];
    }
    return login;
}

/// &lt;summary&gt;
/// Add Claims to a logged in User, from Dynamics CRM info
/// &lt;/summary&gt;
/// &lt;param name="context"&gt;Current Context, url&lt;/param&gt;
/// &lt;param name="entity"&gt;the logged in user/claim&lt;/param&gt;
/// &lt;param name="claims"&gt;The list of claims for the user&lt;/param&gt;
protected override void FillClaimsForEntity(Uri context, SPClaim entity, List&lt;SPClaim&gt; claims) {
    if (claims == null)
        throw new ArgumentNullException("claims");
    if (entity == null)
        throw new ArgumentNullException("entity");

    Logging.LogMessage(entity.Value);

    string login = Utilities.GetLoginPartFromIdentityClaim(entity.Value);

    // if windows user, get the email ?
    if (!string.IsNullOrEmpty(login)) {
        Logging.LogMessage(string.Format("User is {0}", login));

        CRMClient.Entities.User user = null;
        string email = login;
        if (login.Contains("@")) {
            user = CRMClient.CrmSQLClient.GetUserByEmail(login);
        }
        if (login.Contains("\\")) {
            user = CRMClient.CrmSQLClient.GetUser(login);
            if (user != null)
                email = user.Email;
        }
        // employee, crm users
        if (user != null) {
            try {
                Logging.LogMessage(string.Format("User is SystemUser of CRM with an license, Name:{0}", user.FullName));

                claims.Add( GetClaim(CustomClaimsProvider.CustomAccountTypeClaimType, "everyone"));

                SPClaim employee = null;
                if (user.FullLicense) { // admin and or full license
                    employee = GetClaim(CustomClaimsProvider.CustomAccountTypeClaimType, "employee");
                }
                else {// readonly
                    employee = GetClaim(CustomClaimsProvider.CustomAccountTypeClaimType, "employeero");
                }
                if (employee != null)
                    claims.Add(employee);
            }
            catch (Exception exc) {
                Logging.LogException(exc);
            }
        }
        else {
            Logging.LogMessage(string.Format("{0} not found as SYSTEMUSER in CRM", login));
        }
    }
}
</pre>
<h3>Register your Claims Provider for SharePoint</h3>
<p>In order for your Claims Provider to be registered within SharePoint 2010 you will need to create a specific type of Feature.</p>
<ul>
<li>Add a Farm Feature to your Project</li>
<li>Add an EventReicever to your new Feature</li>
<li>And let your receiver inherit from <em>SPClaimProviderFeatureReceiver</em> (see: <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimproviderfeaturereceiver.aspx" target="_blank">Register</a>)</li>
<li>And now implement the following Properties in your Feature Event Receiver
<ul>
<li>ClaimProviderDisplayName</li>
<li>ClaimProviderDescription</li>
<li>ClaimProviderAssembly</li>
<li>ClaimProviderType</li>
</ul>
</li>
</ul>
<p>You can use this to return the last two properties:</p>
<pre class="brush:c#">
/// &lt;summary&gt;Get the Full Assembly Name of the Claim provider we want to register&lt;/summary&gt;
public override string ClaimProviderAssembly {
    get {
        return typeof(CustomClaimsProvider).Assembly.FullName;
    }
}

/// &lt;summary&gt;Get the Class Type of the Claim provider we want to register&lt;/summary&gt;
public override string ClaimProviderType {
    get {
        return typeof(CustomClaimsProvider).FullName;
    }
}
</pre>
<p>That&#8217;s it, you can now register your Claims Provider, and if you want you can use this as is.<br />
Next post will be on these subjects:</p>
<ul>
<li>Create a Trust between your Tusted Identity Provider (STS) and SharePoint 2010</li>
<li>Create or Configure your SP2010 WebApplication to use the Tusted Identity Provider</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/31/writing-your-own-trusted-identity-provider-for-sp2010-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDF Icon in SharePoint</title>
		<link>http://stefvanhooijdonk.com/2010/08/27/pdf-icon-in-sharepoint/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/27/pdf-icon-in-sharepoint/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 11:19:15 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=800</guid>
		<description><![CDATA[This one has been long overdue. There are ton&#8217;s of posts and manuals on how to add the PDF Icon to SharePoint. But I wanted an even simpler solution. Litterly one solution! So here it is! I have created a simple Farm solution. With just one Farm Feature. When activated it will add the PDF [...]]]></description>
			<content:encoded><![CDATA[<p>This one has been long overdue. There are ton&#8217;s of posts and manuals on how to add the PDF Icon to SharePoint. But I wanted an even simpler solution. Litterly one solution!<br />
So here it is!<br />
I have created a simple Farm solution. With just one Farm Feature.<br />
When activated it will add the PDF icon to the infamous <em>DOCICON.xml</em> and upload the PDF Icon itself off course.<br />
<img src="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/SP2010-PDF-Icon-Feature.png" alt="" title="SP2010-PDF-Icon-Feature" width="619" height="49" class="alignnone size-full wp-image-806" /><br />
And then you will have the PDF Icon for your PDF documents.<br />
<img src="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/SP2010-PDF-Icon.png" alt="" title="SP2010-PDF-Icon" width="435" height="57" class="alignnone size-full wp-image-803" /><br />
<a href="http://stefvanhooijdonk.codeplex.com/releases/view/51321#DownloadId=146158" target="_blank">Download the solution here</a>.<br />
If you want to index the contents of a PDF file with SharePoint search, don&#8217;t forget to <a href="http://stefvanhooijdonk.com/2010/01/20/adobe-released-a-x64-pdf-ifilter/" target="_blank">install the Adobe PDF iFilter</a> or the <a href="http://stefvanhooijdonk.com/2009/02/26/pdf-ifilter/" target="_blank">Foxit PDF iFilter</a> ( my favorite ).<br />
Install the solution ( from within the SP2010 Powershell window ) and as Farm Admin!</p>
<pre class="brush:ps;">
write-host -f Green "Add solution: TamTam.SP2010.PDFIcon.wsp"
Get-ChildItem TamTam.SP2010.PDFIcon.wsp | Add-SPSolution
write-host -f Green "Install solution: TamTam.SP2010.PDFIcon"
Install-SPSolution -Identity "TamTam.SP2010.PDFIcon.wsp" -GacDeployment
</pre>
<p>Here is the code from the solution to add the PDF Icon xml element to the <em>DOCICON.xml</em> and to all the Search Applications of the Farm. I also added the removal code in the <em>FeatureDeactivating</em> code in the solution itself!</p>
<pre class="brush:c#;">public class PDFIconEventReceiver : SPFeatureReceiver {

    /// &lt;summary&gt;Const of the docicon FileName&lt;/summary&gt;
    private const string dociconFile = "TEMPLATE\\XML\\DOCICON.xml";

    /// &lt;summary&gt;
    /// Handle the activation of the feature for the PDF Icon for SP2010,
    /// Adds an entry to the SharePoint DOCICON.xml file for the PDF Icon in this solution
    /// &lt;/summary&gt;
    /// &lt;param name="properties"&gt;&lt;/param&gt;
    public override void FeatureActivated(SPFeatureReceiverProperties properties) {

        string dociconXmlFile = string.Format("{0}\\..\\..\\..\\{1}",
            properties.Feature.Definition.RootDirectory,
            dociconFile);

        XmlDocument docicon = new XmlDocument();
        docicon.Load(dociconXmlFile);

        // locate existing PDF icon
        XmlNode pdfnode = docicon.SelectSingleNode("//DocIcons/ByExtension/Mapping[@Key='pdf']");
        if (pdfnode == null) {
            // no existing PDF icon found, add to the file:
            XmlNode rootextentionNode = docicon.SelectSingleNode("//DocIcons/ByExtension");
            if (rootextentionNode != null) {
                // add new Mapping
                pdfnode = docicon.CreateElement("Mapping");

                XmlAttribute key = docicon.CreateAttribute("Key");
                // extention for this mapping
                key.Value = "pdf";
                pdfnode.Attributes.Append(key);

                XmlAttribute value = docicon.CreateAttribute("Value");
                // url of this solution's pdf icon image
                value.Value = "TamTam.SP2010.PDFIcon/pdficon_small.gif";
                pdfnode.Attributes.Append(value);

                rootextentionNode.AppendChild(pdfnode);
                // save new docicon file to disk
                docicon.Save(dociconXmlFile);
            }
        }
        // add the PDF Icon to the SearchApplications
        foreach (SearchServiceApplication service in SearchService.Service.SearchApplications) {
            // open the Content
            Content content = new Content(service);
            // register the icon as an Extention
            try { content.ExtensionList.Create("pdf"); }
            catch { }
        }
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/27/pdf-icon-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint and Web.config modifications</title>
		<link>http://stefvanhooijdonk.com/2010/08/25/sharepoint-and-web-config-modifications/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/25/sharepoint-and-web-config-modifications/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 11:48:36 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=788</guid>
		<description><![CDATA[Ever since MOSS 2007 we all know the Web.Config Modifications Manager within the SharePoint API. But today I stumbled upon this PowerShell commandlet: Add-WebConfiguration. This commandlet is from the IIS7(.5) powershell module WebAdministration. The short version is, you can use this in you deploy script to do Web.Config modifications Example for an AppSettings Configuration Key:&#8221; Add-WebConfiguration [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since MOSS 2007 we all know the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebapplication.webconfigmodifications.aspx" target="_blank">Web.Config Modifications Manager</a> within the SharePoint API. But today I stumbled upon this PowerShell commandlet: <a href="http://technet.microsoft.com/en-us/library/ee807834.aspx" target="_blank">Add-WebConfiguration</a>. This commandlet is from the IIS7(.5) powershell module <a href="http://technet.microsoft.com/en-us/library/ee790599.aspx" target="_blank">WebAdministration</a>.</p>
<p>The short version is, you can use this in you deploy script to do Web.Config modifications</p>
<p>Example for an AppSettings Configuration Key:&#8221;</p>
<pre class="brush:ps">Add-WebConfiguration /appSettings "IIS:\sites\Default Web Site" -atIndex 0 -Value @{key="DBConnectionString";value="server=10.2.34.1"}</pre>
<p>This will result in the following addition of your Web.Config.</p>
<pre class="brush:xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;configuration&gt;
    &lt;appSettings&gt;
        &lt;add key="DBConnectionString" value="server=10.2.34.1" /&gt;
    &lt;/appSettings&gt;
&lt;/configuration&gt;</pre>
<p>Note: Be carefull with ANY Web.Config modification, you can break stuff!<br />
Load the WebAdministration module in powershell:</p>
<pre class="brush:ps">#load webadministration powershell module
$hasSnapin = get-pssnapin | Select { $_.Name.toLower().Trim() = "webadministration" }
if ($hasSnapin -ne $null) {
  # IIS7 / Windows 2008
  add-pssnapin WebAdministration
} else {
  # IIS7.5 / Windows 2008 R2
  import-module WebAdministration
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/25/sharepoint-and-web-config-modifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Provisioning Publishing Pages</title>
		<link>http://stefvanhooijdonk.com/2010/08/23/provisioning-publishing-pages/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/23/provisioning-publishing-pages/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 15:24:41 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=736</guid>
		<description><![CDATA[On the interweb there seems to be some confusion on how to provision publishing resources through features. Here is what works for SharePoint 2010. First you wil need a Feature scoped for Site (SPSite), put your ContenType module here. And a Feature scoped for Web and add the other modules here! 1. Create a Page ContentType [...]]]></description>
			<content:encoded><![CDATA[<p>On the interweb there seems to be some confusion on how to provision publishing resources through features.<br />
Here is what works for SharePoint 2010.<br />
First you wil need a Feature scoped for Site (SPSite), put your ContenType module here.<br />
And a Feature scoped for Web and add the other modules here!</p>
<h2>1. Create a Page ContentType</h2>
<p>Add a New ContentType to your project. VS 2010 will ask you from which ContentType you want to inherit, select <em>Article Page</em>.<br />
You will get a new <em>ContentTypeId</em>!<br />
Supply a Name, Group and Description for your Page ContentType.</p>
<pre class="brush:xml;">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;!-- Parent ContentType: Article Page (0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D) --&gt;
  &lt;ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00d77cd9769a6443cd8dce93ee832e8303"
               Name="CustomPageContentType"
               Group="Site Content Types"
               Description="My Page Content Type"
               Inherits="TRUE"
               Version="0"&gt;
    &lt;FieldRefs&gt;
      &lt;!-- Supply fields here --&gt;
    &lt;/FieldRefs&gt;
  &lt;/ContentType&gt;
&lt;/Elements&gt;</pre>
<p>Add the (Publishing) Fields you want to use in your Publishing Pages.</p>
<h2>2. Provision a MasterPage</h2>
<p>Now add an empty Module, name it <em>MasterPages</em> and remove the sample.txt.<br />
Add your <em>Site.Master</em> page to your newly created module<br />
Open the <em>Element.xml</em> of your module<br />
Apply the following changes:</p>
<ul>
<li>Add RootWebOnly=&#8221;TRUE&#8221; to you Module</li>
<li>Add a <em>Title</em> to your File</li>
<li>Add a <em>Description</em> to your File</li>
<li>Add a <em>ContentType</em> to your File with the value <em>$Resources:cmscore,contenttype_masterpage_name;</em>, cause this is a masterpage!</li>
</ul>
<pre class="brush:xml; highlight: [4, 13];">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;!-- Mind the RootWebOnly attibute here --&gt;
  &lt;Module Name="MasterPages" Url="_catalogs/masterpage" RootWebOnly="TRUE"&gt;
    &lt;File Path="PageLayouts\Site.master" Url="Ordina.master" Type="GhostableInLibrary" &gt;
      &lt;!-- Required --&gt;
      &lt;Property Name="Title" Value="Site Master Page" /&gt;
      &lt;!-- optional --&gt;
      &lt;Property Name="MasterPageDescription" Value="Master Page for Site" /&gt;
      &lt;!-- optional --&gt;
      &lt;Property Name="PublishingPreviewImage" Value="" /&gt;
      &lt;!-- Required and important, leave this value like this (MasterPage) --&gt;
      &lt;Property Name="ContentType" Value="$Resources:cmscore,contenttype_masterpage_name;" /&gt;
    &lt;/File&gt;
  &lt;/Module&gt;
&lt;/Elements&gt;</pre>
<h2>3. Provision a Publishing PageLayout</h2>
<p>Add your PageLayout to either a new Module or the MasterPage Module. If you create a new Module, don&#8217;t forget to add the <em>RootWebOnly=&#8221;TRUE&#8221;</em>.</p>
<pre class="brush:xml; highlight: [4, 11,13,14];">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;!-- Mind the RootWebOnly attibute here --&gt;
  &lt;Module Name="PageLayouts" Url="_catalogs/masterpage" RootWebOnly="TRUE"&gt;
    &lt;File Path="PageLayouts\PageLayout.aspx" Url="PageLayouts/PageLayout.aspx" Type="GhostableInLibrary" &gt;
      &lt;!-- Required --&gt;
      &lt;Property Name="Title" Value="Site WelcomePage" /&gt;
      &lt;!-- Optinal --&gt;
      &lt;Property Name="MasterPageDescription" Value="Description" /&gt;
      &lt;!-- Required and important, leave this value like this, THIS IS A PageLayout! --&gt;
      &lt;Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" /&gt;
      &lt;!-- Required and important and use your CustomPageContentType ContentTypeId here ! --&gt;
      &lt;Property Name="PublishingAssociatedContentType"
                Value=";#CustomPageContentType;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00d77cd9769a6443cd8dce93ee832e8303;#"/&gt;
      &lt;!-- Optional, add default webpart(s) to zones --&gt;
      &lt;AllUsersWebPart WebPartZoneID="WebPartZoneTop" WebPartOrder="1"&gt;
        &lt;![CDATA[ WebPart XML here ]]&gt;
      &lt;/AllUsersWebPart&gt;
    &lt;/File&gt;
  &lt;/Module&gt;
&lt;/Elements&gt;</pre>
<p>You can also add &#8220;default&#8221; WebParts to you page layout with the <em>AllUsersWebPart</em> tag.</p>
<h2>4. Provision a Publishing Page</h2>
<p>And you can even provision Publishing Pages with a module.<br />
Now add an empty Module, name it <em>DefaultPages</em> and remove the sample.txt.<br />
Open the <em>Element.xml</em> of your module<br />
I have provided a sample here, please note the following:</p>
<ul>
<li>Use the <em>ContentTypeBinding</em> to bind your <em>CustomPageContentType</em> to the Pages list</li>
<li>Use the <em>default.aspx</em> from the default SharePoint Site Definition <em>SPS</em> by adding the <em>SetupPath</em> attribute to your Module (more <a href="http://stefan-stanev-sharepoint-blog.blogspot.com/2010/07/provision-publishing-pages-in-sandbox.html" target="_blank">here</a>).</li>
<li>You can provision WebParts and Field Values</li>
<li>To deploy multiple Publishing Pages add another File ellement, and change the <em>Url</em> attribute of the File Element, to create another page.</li>
<li>You can use the feature to provision Pages from within you Onet.xml, but don&#8217;t forget to activate dependand features first ( Publishing Infrastructure, Publishing, optional ContentTypes )</li>
</ul>
<pre class="brush:xml; highlight: [4,5,7,13,15,17];">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;!-- Add your CustomPageContentType ContentTypeId to the Pages List --&gt;
  &lt;ContentTypeBinding ContentTypeId="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00d77cd9769a6443cd8dce93ee832e8303"
                      ListUrl="Pages" /&gt;
  &lt;Module Name="ProvisionDefaultPages" Url="$Resources:osrvcore,List_Pages_UrlName;"
          SetupPath="SiteTemplates\SPS" &gt;
    &lt;!-- Note the Url of this File element --&gt;
    &lt;File Path="default.aspx" Url="default.aspx" Type="GhostableInLibrary"&gt;
      &lt;!-- Required --&gt;
      &lt;Property Name="Title" Value="HomePage" /&gt;
      &lt;!-- Required, Use the ContentType CustomPageContentType you created earlier ! --&gt;
      &lt;Property Name="ContentType" Value="CustomPageContentType" /&gt;
      &lt;!-- Required, Use the PageLayout you created earlier --&gt;
      &lt;Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/PageLayout.aspx, Site WelcomePage" /&gt;
      &lt;!-- Optional Extra attributes --&gt;
      &lt;Property Name="PublishingPageContent" Value="WebContent field value" /&gt;
      &lt;!-- Optional, add default webpart(s) to zones --&gt;
      &lt;AllUsersWebPart WebPartZoneID="WebPartZoneTop" WebPartOrder="1"&gt;
        &lt;![CDATA[ WebPart XML here ]]&gt;
      &lt;/AllUsersWebPart&gt;
    &lt;/File&gt;
    &lt;!-- Note the Url of this File element --&gt;
    &lt;File Path="default.aspx" Url="anotherpage.aspx" Type="GhostableInLibrary"&gt;
      &lt;!-- Required --&gt;
      &lt;Property Name="Title" Value="Another Page" /&gt;
      &lt;!-- Required, Use the CustomPageContentType ContentType you created earlier --&gt;
      &lt;Property Name="ContentType" Value="CustomPageContentType" /&gt;
      &lt;!-- Required, Use the PageLayout you created earlier --&gt;
      &lt;Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/PageLayout.aspx, Site WelcomePage" /&gt;
      &lt;!-- Optional Extra attributes --&gt;
      &lt;Property Name="PublishingPageContent" Value="WebContent field value" /&gt;
      &lt;!-- Optional, add default webpart(s) to zones --&gt;
      &lt;AllUsersWebPart WebPartZoneID="WebPartZoneTop" WebPartOrder="1"&gt;
        &lt;![CDATA[ WebPart XML here ]]&gt;
      &lt;/AllUsersWebPart&gt;    &lt;/File&gt;
  &lt;/Module&gt;
&lt;/Elements&gt;</pre>
<h2>5. Small bonus tip</h2>
<p>When you deploy MasterPages and PageLayouts through features, they become part of the site collection. You provision these files in the <em>_catalog/MasterPages</em> SPList of your Site Collection! Now default SharePoint won&#8217;t load the contents of your deployed masterpages and pagelayouts into the actual ContentDb. It only uses a reference in the ContentDb to the actual file on Disk in your Feature folder. So updating these PageLayouts and MasterPages can be done by uploading a new Solution with the updated Files.<br />
But user&#8217;s can change files in the Site Collection through SharePoint Designer. If a User Customizes a MasterPage or PageLayout, it becomes Customized or Un-Ghosted. This means the file contents are <em>now</em> stored in the ContentDb! And when you re-deploy your solution with your new feature and files (update the feature version number!) you would expect to see your changes, but you won&#8217;t!</p>
<p>You can use the object model to undo this, <a href="http://stsadm.blogspot.com/2007/09/re-ghosting-pages.html" target="_blank">Re-Ghosting</a>, by calling the <em>RevertContentStream()</em> on the SPFile of your PageLayout or MasterPage.<br />
I have written a method for that which you can call from the Feature Event Receiver Activate and Upgrade (version number of your feature <img src='http://stefvanhooijdonk.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ):</p>
<pre class="brush:c#; highlight:[68]">    /// &lt;summary&gt;
    /// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;
    /// The GUID attached to this class may be used during packaging and should not be modified.
    /// &lt;/remarks&gt;
    [Guid("fa5fdea4-f3be-4b17-8942-528517b2e28c")]
    public class ProvisioningEventReceiver : SPFeatureReceiver {

        public override void FeatureActivated(SPFeatureReceiverProperties properties) {
            UpdateFilesForFeature(properties);
        }

        //public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        //{
        //}

        public override void FeatureUpgrading(SPFeatureReceiverProperties properties, string upgradeActionName, System.Collections.Generic.IDictionary&lt;string, string&gt; parameters) {
            UpdateFilesForFeature(properties);
        }

        /// &lt;summary&gt;
        /// Update files for a Feature, based on defaults and file extentions.
        /// &lt;/summary&gt;
        /// &lt;param name="feature"&gt;The feature&lt;/param&gt;
        public static void UpdateFilesForFeature(SPFeatureReceiverProperties feature) {
            // locate the webpart and dwp file for this feature
            string layoutdirectory = feature.Definition.RootDirectory;
            if (!layoutdirectory.EndsWith("/"))
                layoutdirectory += "/";
            layoutdirectory += "PageLayouts";

            string[] featurefiles = System.IO.Directory.GetFiles(layoutdirectory);

            List&lt;string&gt; featurefilesList = new List&lt;string&gt;();
            foreach (string filename in featurefiles) {
                string ext = System.IO.Path.GetExtension(filename).ToLowerInvariant();

                if (ext.EndsWith("aspx") || ext.EndsWith("master") || ext.EndsWith("xml"))
                    featurefilesList.Add(System.IO.Path.GetFileName(filename).ToLowerInvariant());

                Logging.LogMessage("added to list: " + filename);
            }

            if (featurefilesList.Count &gt; 0) {
                Logging.LogMessage("no files found");
                SPSite site = Base.Feature.GetActivationSite(feature);
                if (site != null) {
                    // locate the masterpages/page layouts list
                    SPList masterpagegallery = null;

                    foreach (SPList list in site.RootWeb.Lists) {
                        if (list.BaseTemplate == SPListTemplateType.MasterPageCatalog) {
                            masterpagegallery = list;
                            break;
                        }
                    }
                    if (masterpagegallery != null) {
                        Logging.LogMessage("Checking Masterpage Gallery: " + masterpagegallery.Title);
                        Logging.LogMessage("items " + masterpagegallery.Items.Count);
                        foreach (SPListItem pagelayout in masterpagegallery.Items) {
                            Logging.LogMessage("checking layout " + pagelayout.Name);
                            if (featurefilesList.Contains(pagelayout.File.Name.ToLowerInvariant())) {
                                // just uncustomize the pages for the given feature, so that MOSS will point to
                                // the disk version of these (new) files.
                                if (pagelayout.File.CustomizedPageStatus == SPCustomizedPageStatus.Customized) {
                                    // make the page uncustomized
                                    pagelayout.File.RevertContentStream();
                                    Logging.LogMessage("Uncustomized the item: " + pagelayout.File.Name);
                                }
                                else {
                                    Logging.LogMessage("The item was already uncustomized: " + pagelayout.File.Name);
                                }
                            }
                        }
                    }
                }
            }
        }
    }</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/23/provisioning-publishing-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing your own Trusted Identity provider for SP2010 (1)</title>
		<link>http://stefvanhooijdonk.com/2010/08/19/writing-your-own-trusted-identity-provider-for-sp2010-1/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/19/writing-your-own-trusted-identity-provider-for-sp2010-1/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 08:57:42 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Claims]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=684</guid>
		<description><![CDATA[With the introduction of the Windows Identity Framework and SharePoint 2010 it is now possible to have multiple authentication providers on a Single URL on a SPWebApplication. Especialy in an Extranet scenario this is very usefull: Employees login with their AD Account Partners, suppliers, customers login through a (Custom) Trusted Identity Provider ( Like facebook,OpenID [...]]]></description>
			<content:encoded><![CDATA[<p>With the introduction of the Windows Identity Framework and SharePoint 2010 it is now possible to have multiple authentication providers on a Single URL on a SPWebApplication.<br />
Especialy in an Extranet scenario this is very usefull:</p>
<ul>
<li>Employees login with their AD Account</li>
<li>Partners, suppliers, customers login through a (Custom) <em>Trusted Identity Provider</em> ( Like facebook,OpenID or custom )</li>
</ul>
<p>Image you have a CRM Application (like Microsoft Dynamics CRM 4) where you store all the relations (contacts) your company has with customers, partners and suppliers. You can use this information, e.g. the email addresses and a custom field for a password, to create your own Identity Provider and provide access to your extranet/collaboration portal based on the information stored in the CRM application.</p>
<p>In 2007 you would extend your SPWebApplication and configure Forms Based Authentication. You would lose the Client Integration Features of Office (2007), and you needed to configure your Membership Provider in the Web.Config.</p>
<p>In 2010 we can use a <a href="http://blogs.msdn.com/b/russmax/archive/2010/05/27/understanding-sharepoint-2010-claims-authentication.aspx">Identity provider/Claim Provider</a>. There are some major differences / benefits in comparison to a custom Membership Provider. With an Identity Provider ( custom or not ):</p>
<ul>
<li>You can use the Integration Features of the Office (2010) Client</li>
<li>All users connect on the same url / WebApplication</li>
<li>You can re-use a Identity Provider on more than one WebApp (it&#8217;s now just a <em>Trust</em> thing)</li>
<li>You have Single Sing On (SSO) for free with other WebApps that Trust the same Identity Provider</li>
<li>Configuration is done through PowerShell on all servers at once!</li>
</ul>
<p>This will be a Multi Blog post on &#8220;writing your own Trusted Identity provider / Claim Provider for SP2010&#8243;.<br />
In order to have a working Trusted Identity provider for SharePoint you will need to do a couple of things:</p>
<ul>
<li>Create a Custom <a href="http://msdn.microsoft.com/en-us/magazine/dd347547.aspx" target="_blank">Security Token Service</a> with the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&amp;displaylang=en" target="_blank">Windows Identity Framework SDK</a></li>
<li>Create a Custom <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimprovider.aspx" target="_blank">SPClaimProvider</a> ( see <a href="http://stefvanhooijdonk.com/2010/08/31/writing-your-own-trusted-identity-provider-for-sp2010-2/" target="_blank">part 2</a> )</li>
<li><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimproviderfeaturereceiver.aspx" target="_blank">Register</a> your Custom SPClaimProvider ( see <a href="http://stefvanhooijdonk.com/2010/08/31/writing-your-own-trusted-identity-provider-for-sp2010-2/" target="_blank">part 2</a> )</li>
<li>Create a Trust between your Tusted Identity Provider (STS) and SharePoint 2010</li>
<li>Create or Configure your SP2010 WebApplication to use the Tusted Identity Provider</li>
</ul>
<p>This post will focus on how to create a Custom Security Token Service with the Windows Identity Framework SDK.</p>
<ol>
<li>Download and install <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&amp;displaylang=en" target="_blank">Windows Identity Framework SDK</a> for .Net 4.0 ( and thus VS 2010 )<br />
SP2010 runs on .Net 3.5 but since this is a Separate IIS WebApplication you use the 4.0</li>
<li>Create a new Web Project with VS2010 based on the <em>ASP.Net Security Token Service Web Site</em> template
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/vs2010-wif-4.0-sts.png"><img class="alignnone size-medium wp-image-693" title="vs2010-wif-4.0-sts" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/vs2010-wif-4.0-sts-300x101.png" alt="" width="300" height="101" /></a></p>
<p>This will be the Website used by users to actually login to</li>
<li>Note the following important classes/methods in the project:<br />
<a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/vs2010-wif-4.0-sts-website.png"><img class="alignnone size-full wp-image-694" title="vs2010-wif-4.0-sts-website" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/vs2010-wif-4.0-sts-website.png" alt="" width="325" height="253" /></a></p>
<ul>
<li>CustomSecurityTokenService.cs, and especially the method: <em>GetOutputClaimsIdentity</em></li>
<li>Login.aspx, and especially the CodeBehind: <em>Page_Load</em></li>
<li>Web.Config, and especially the appSettings: <em>IssuerName</em> and <em>SigningCertificateName</em></li>
</ul>
</li>
<li>Implement the method <em>GetOutputClaimsIdentity</em>, <br />here I have chosen to login with the user&#8217;s email address.
<pre class="brush:c#">/// &lt;summary&gt;This method returns the claims to be issued in the token.&lt;/summary&gt;
/// &lt;param name="principal"&gt;The caller's principal.&lt;/param&gt;
/// &lt;param name="request"&gt;The incoming RST, can be
/// used to obtain addtional information.&lt;/param&gt;
/// &lt;param name="scope"&gt;The scope information
/// corresponding to this request.&lt;/param&gt;
/// &lt;exception cref="ArgumentNullException"&gt;If 'principal'
/// parameter is null.&lt;/exception&gt;
/// &lt;returns&gt;The outgoing claimsIdentity to be included
/// in the issued token.&lt;/returns&gt;
protected override IClaimsIdentity GetOutputClaimsIdentity(IClaimsPrincipal principal,
                                        RequestSecurityToken request,
                                        Scope scope) {
    if (null == principal) {
        throw new ArgumentNullException("principal");
    }
    // name = the email address of the user
    string name = principal.Identity.Name;
    // create the new identity
    ClaimsIdentity outputIdentity = new ClaimsIdentity();
    // add new claim based on login/email
    outputIdentity.Claims.Add(new Claim(
      System.IdentityModel.Claims.ClaimTypes.Email,
      principal.Identity.Name));
    // return the claim
    return outputIdentity;
}
</pre>
<div>If you want to add more claims you can! You could add claims to the output here to facilitate groups of users.</div>
</li>
<li>Implement the Login button/event in the Login page
<pre class="brush:c#">
/// &lt;summary&gt;Handle the Page Load&lt;/summary&gt;
/// &lt;param name="sender"&gt;&lt;/param&gt;
/// &lt;param name="e"&gt;&lt;/param&gt;
protected void Page_Load(object sender, EventArgs e) {
    // Note: Add code to validate user name, password. This code is for illustrative purpose only.
    // Do not use it in production environment.
    if (!string.IsNullOrEmpty(txtUserName.Text)) {
        // Check credentials agains backoffice (Dynamics CRM 4 in this case)
        if (CrmSQLClient.ValidateContactLogin(txtUserName.Text, txtPassword.Text)){
            // Login info is valid, redirect the user.
            if (Request.QueryString["ReturnUrl"] != null) {
                FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, false);
            }
            else {
                FormsAuthentication.SetAuthCookie(txtUserName.Text, false);
                Response.Redirect("default.aspx");
            }
        }
    }
}
</pre>
</li>
<li>Change the login page front end</li>
<li>Add extra functions like &#8220;Forgot my password&#8221; or &#8220;Register for an account&#8221; now or later</li>
<li>Deploy your webapplication to IIS.<br />
You should now be able to login to your custom STS with a browser:<br />
<a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/vs2010-wif-4.0-sts-website-login.png"><img class="alignnone size-medium wp-image-703" title="vs2010-wif-4.0-sts-website-login" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/vs2010-wif-4.0-sts-website-login-300x108.png" alt="" width="300" height="108" /></a></li>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/08/vs2010-wif-4.0-sts-website-login.png"> </a></p>
<li>Create a proper <em>&#8220;FederationMetadata.xml&#8221;</em>.<br />
This was a bit hard for me at first. But there is an <a href="http://weblogs.thinktecture.com/cweyer/2009/05/geneva-based-ws-federation-metadata-document-generation-wizard-or-oops-i-did-it-again.html" target="_blank">App</a> for that!</p>
<ul>
<li>Provide the proper values for the WS-Federation Metadata Generator</li>
<li>You will need a Certificate to sign the <em>&#8220;FederationMetadata.xml&#8221;</em> document</li>
<li>Copy the new <em>&#8220;FederationMetadata.xml&#8221;</em> to your published STS Website</li>
</ul>
</li>
<li>Test your new STS WebApplication by logging in. You might get an error when you first test this. Use this url to test if your login page works:<em>http://test-server/default.aspx?&#038;wa=wsignin1.0</em></li>
<li>There is one thing left to do when you want to use your Identity Provider: install a certificate on the Web Server, and use that to sign the <em>FederationMetadata.xml</em> and update the Web.Config of your provider to reference this certificate in the <em>IssuerName</em>.</li>
</ol>
<p>Next <a href="http://stefvanhooijdonk.com/2010/08/31/writing-your-own-trusted-identity-provider-for-sp2010-2/" target="_blank">post will descibe the SPClaimProvider to create and register</a>.</p>
<p>And be sure to check-out some small &#8220;issues&#8221; with <a href="http://stefvanhooijdonk.com/category/claims/" target="_blank">Claims Based authentication</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/19/writing-your-own-trusted-identity-provider-for-sp2010-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SPModule, install SharePoint 2010 through PowerShell</title>
		<link>http://stefvanhooijdonk.com/2010/08/17/spmodule-install-sharepoint-2010-through-powershell/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/17/spmodule-install-sharepoint-2010-through-powershell/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 08:19:21 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=672</guid>
		<description><![CDATA[SPModule is a Windows PowerShell module written by members of the SharePoint Product Group in our spare time.   SPModule is an example of how we would envision you accomplish various common tasks within Windows PowerShell in a SharePoint 2010 environment.]]></description>
			<content:encoded><![CDATA[<p>Dan Winter &amp; Zach Rosenfield inform us that they have released <a href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=54" target="_blank">SPModule</a>:</p>
<p>&#8220;SPModule is an example of how we would envision you accomplish various common tasks within Windows PowerShell in a SharePoint 2010 environment.  We hope to position various best practices from these scripts and we hope in the long term to reference these also within technet.  These blog posts serve simply as our first location of sharing them, and this post will be updated once we have the samples hosted within technet.  The scripts themselves are not officially supported.&#8221;</p>
<p>The <a href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=54" target="_blank">post</a></p>
<p>The <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=c57556ff-8df0-44fd-aba6-3df01b9f80ce" target="_blank">download</a></p>
<p>Example: &#8220;Install SharePoint Bits (including Prereqs)&#8221;</p>
<pre class="brush: powershell; ruler: true; first-line: 1; toolbar: true;">
Install-SharePoint -SetupExePath “\\servername\SharePoint2010\setup.exe” -PIDKey "PKXTJ-DCM9D-6MM3V-G86P8-MJ8CY"
New-SharePointFarm –DatabaseAccessAccount Get-Credential DOMAIN\username –DatabaseServer "SQL01" –FarmName "TestFarm"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/17/spmodule-install-sharepoint-2010-through-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010 Site recycle bin released</title>
		<link>http://stefvanhooijdonk.com/2010/08/04/sharepoint-2010-site-recycle-bin-released/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/04/sharepoint-2010-site-recycle-bin-released/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 19:39:55 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=656</guid>
		<description><![CDATA[The SP2010 team released the Admin tool we have all be waiting for: The SharePoint Site Recycle Bin for SharePoint 2010 is available for download at http://governance.codeplex.com &#8220;The SharePoint Site Recycle Bin is a SharePoint Foundation 2010 solution package that when deployed to a Microsoft SharePoint Foundation 2010 or Microsoft SharePoint Server 2010 server farm [...]]]></description>
			<content:encoded><![CDATA[<p>The SP2010 team released the Admin tool we have all be waiting for: The SharePoint Site Recycle Bin for SharePoint 2010 is available for download at <a href="http://governance.codeplex.com" target-"_blank">http://governance.codeplex.com</a></p>
<p>&#8220;The SharePoint Site Recycle Bin is a SharePoint Foundation 2010 solution package that when deployed to a Microsoft SharePoint Foundation 2010 or Microsoft SharePoint Server 2010 server farm enables administrators to create a snapshot of subscriptions, site collections and Webs as they are deleted through the SharePoint user interface, the SharePoint Administration Tool, the SharePoint 2010 Management Shell, SharePoint 2010 Central Administration, or SharePoint Designer.&#8221;</p>
<p>Via <a href="http://blogs.technet.com/b/wbaer/archive/2010/08/04/sharepoint-site-recycle-bin-for-sharepoint-2010.aspx">http://blogs.technet.com/b/wbaer/archive/2010/08/04/sharepoint-site-recycle-bin-for-sharepoint-2010.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/04/sharepoint-2010-site-recycle-bin-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom SPJobDefinition and &#8220;Access denied&#8221; error</title>
		<link>http://stefvanhooijdonk.com/2010/08/02/custom-spjobdefinition-and-access-denied-error/</link>
		<comments>http://stefvanhooijdonk.com/2010/08/02/custom-spjobdefinition-and-access-denied-error/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 14:35:07 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=646</guid>
		<description><![CDATA[If you create a custom SPJobDefinition and use a Feature Event Receiver to deploy and install this (Timer) SPJobDefinition you receive an error when you call the Update() method: &#8220;Access Denied&#8221; How to code and install a SPJobDefinition Paul Kotlyar found this on the subject: &#8220;Upon detailed investigation of Microsoft.SharePoint.dll  I discovered that SharePoint guys added a [...]]]></description>
			<content:encoded><![CDATA[<p>If you create a custom SPJobDefinition and use a Feature Event Receiver to deploy and install this (Timer) SPJobDefinition you receive an error when you call the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spjobdefinition.update.aspx" target="_blank">Update() </a>method:</p>
<p>&#8220;Access Denied&#8221;</p>
<p>How to <a href="http://msdn.microsoft.com/ru-ru/library/cc427068(en-us).aspx" target="_blank">code and install a SPJobDefinition</a></p>
<p><a href="http://unclepaul84.blogspot.com/2010/06/sppersistedobject-xxxxxxxxxxx-could-not.html" target="_blank">Paul Kotlyar</a> found this on the subject:</p>
<p>&#8220;Upon detailed investigation of <strong>Microsoft.SharePoint.</strong><strong>dll</strong>  I discovered that SharePoint guys added a new security feature to all objects inheriting from SPPersistedObject in the Microsoft.SharePoint.Administration namespace. This feature explicitly disallows modification of the above stated objects from content web applications, which is where our web part is running. The error message thrown is therefore very misleading. After some more tracing through the code I found a property in SharePoint API which controls this behavior: <strong>SPWebService.ContentService.RemoteAdministratorAccessDenied</strong>&#8221;</p>
<p>Here is how to fix this Access Denied (through powershell):</p>
<pre class="brush: powershell; ruler: true; first-line: 1; highlight: [14, 16, 18];toolbar: true;">
$snapin="Microsoft.SharePoint.PowerShell"
if (get-pssnapin $snapin -ea "silentlycontinue") {
  write-host -f Green "PSsnapin $snapin is loaded"
}
elseif (get-pssnapin $snapin -registered -ea "silentlycontinue") {
  write-host -f Green "PSsnapin $snapin is registered"
  Add-PSSnapin $snapin
  write-host -f Green "PSsnapin $snapin is loaded"
}
else {
  write-host -f Red "PSSnapin $snapin not found"
}
# get content web service
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
# turn off remote administration security
$contentService.RemoteAdministratorAccessDenied = $false
# update the web service
$contentService.Update()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/08/02/custom-spjobdefinition-and-access-denied-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download a solution from your Farm (SP2100)</title>
		<link>http://stefvanhooijdonk.com/2010/07/30/download-a-solution-from-your-farm-sp2100/</link>
		<comments>http://stefvanhooijdonk.com/2010/07/30/download-a-solution-from-your-farm-sp2100/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 07:04:10 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=636</guid>
		<description><![CDATA[Wanted to download a solution from my farm. So did it with PowerShell: param([string]$folder) write-host "" write-host -f Green "Get Solutions from Farm - Stef van Hooijdonk - v1.0" write-host "" $snapin="Microsoft.SharePoint.PowerShell" if (get-pssnapin $snapin -ea "silentlycontinue") { write-host -f Green "PSsnapin $snapin is loaded" } else { if (get-pssnapin $snapin -registered -ea "silentlycontinue") { [...]]]></description>
			<content:encoded><![CDATA[<p>Wanted to download a solution from my farm. So did it with PowerShell:</p>
<pre class="brush: powershell; ruler: true; first-line: 1; toolbar: true;">

param([string]$folder)
write-host ""
write-host -f Green "Get Solutions from Farm - Stef van Hooijdonk - v1.0"
write-host ""
$snapin="Microsoft.SharePoint.PowerShell"
if (get-pssnapin $snapin -ea "silentlycontinue") {
  write-host -f Green "PSsnapin $snapin is loaded"
}
else {
  if (get-pssnapin $snapin -registered -ea "silentlycontinue") {
    write-host -f Green "PSsnapin $snapin is registered"
    Add-PSSnapin $snapin
    write-host -f Green "PSsnapin $snapin is loaded"
  }
  else {
  write-host -f Red "PSSnapin $snapin not found"
}
}
write-host ""
$folder = Join-Path -Path $folder \ -resolve
if ( Test-Path $folder ) {
  $farm = Get-SPFarm
  foreach($sol in $farm.Solutions){
    $solutionFileName = $folder +$sol.SolutionFile.Name
    $sol.SolutionFile.SaveAs($solutionFileName )
    Write-Host "- saved" $sol.SolutionFile.Name
  }
}
else {
  Write-Host -f Red "ERROR: Folder ""$folder"" does not exist"
}
write-host ""</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/07/30/download-a-solution-from-your-farm-sp2100/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010 and WSS v4 Cumulative Update 1</title>
		<link>http://stefvanhooijdonk.com/2010/07/22/sharepoint-2010-and-wss-v4-cumulative-update-1/</link>
		<comments>http://stefvanhooijdonk.com/2010/07/22/sharepoint-2010-and-wss-v4-cumulative-update-1/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 14:17:10 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=626</guid>
		<description><![CDATA[I do not know how Stefan found this, but it&#8217;s here: the first cumulative update for WSS v4 and SharePoint 2010. (22-07-2010) The knowledge base articles are not present yet, so no word on what is updated. Don&#8217;t rush to install them just yet (26-7-2010) The knowledge base articles are present now. And the Claims [...]]]></description>
			<content:encoded><![CDATA[<p>I do not know how <a href="http://blogs.technet.com/b/stefan_gossner/" target="_blank">Stefan </a>found this, but it&#8217;s here: the first cumulative update for WSS v4 and SharePoint 2010.</p>
<p>(22-07-2010) The knowledge base articles are not present yet, so no word on what is updated. Don&#8217;t rush to install them just yet <img src='http://stefvanhooijdonk.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(26-7-2010) The knowledge base articles are present now. And the Claims based authentication <a href="http://stefvanhooijdonk.com/2010/07/14/claims-based-authentication-and-the-outlook-social-connector-dont-work-together/" target="_blank">issue </a>with Outlook social connector is now fixed!!</p>
<p>ServicePack 1 when it will be released will include these also.</p>
<p>Download links are found here:</p>
<p><a href="http://blogs.technet.com/b/stefan_gossner/archive/2010/07/22/the-first-cumulative-update-for-sharepoint-2010-family-has-been-released.aspx" target="_blank">http://blogs.technet.com/b/stefan_gossner/archive/2010/07/22/the-first-cumulative-update-for-sharepoint-2010-family-has-been-released.aspx</a></p>
<p>(Direct links: )</p>
<p>Microsoft SharePoint Foundation 2010:</p>
<ul>
<li><a href="http://support.microsoft.com/kb/2028568" target="_blank">KB2028568</a> – <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2028568&amp;kbln=en-us">Download</a></li>
</ul>
<p>Microsoft SharePoint Server 2010:</p>
<ul>
<li><a href="http://support.microsoft.com/kb/983319" target="_blank">KB983319</a> – <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=983319">Download</a> (Search 2010 related)</li>
<li><a href="http://support.microsoft.com/kb/983497" target="_blank">KB983497</a> – <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=983497">Download</a> (SP2010 related)</li>
<li>KB 2182938 – (localized Japanese only) - <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2182938&amp;kbln=en-us">Download</a></li>
<li><a href="http://support.microsoft.com/kb/2281364">KB2281364</a> – <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2281364&amp;kbln=en-us">Download</a> (SP2010 related)</li>
<li><a href="http://support.microsoft.com/kb/2124512">KB2124512</a> – <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2124512&amp;kbln=en-us">Download</a> (FilterPack related)</li>
<li><a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;2204024">KB2204024</a> &#8211; <a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2204024&amp;kbln=en-us">Download</a> (WebAnalytics related)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/07/22/sharepoint-2010-and-wss-v4-cumulative-update-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft announces the release of the SharePoint 2010 Administration Toolkit v1</title>
		<link>http://stefvanhooijdonk.com/2010/07/16/microsoft-announces-the-release-of-the-sharepoint-2010-administration-toolkit-v1/</link>
		<comments>http://stefvanhooijdonk.com/2010/07/16/microsoft-announces-the-release-of-the-sharepoint-2010-administration-toolkit-v1/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 12:50:16 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=623</guid>
		<description><![CDATA[Jet Li posted this over at the SharePoint Team Blog: &#8220;I am pleased to announce the availability of the first version of the SharePoint 2010 Administration Toolkit. In this toolkit we’ve included a couple of tools that were shipped releases and are now adapted to SharePoint 2010, along with two new tools.&#8221; The toolkit can be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.msdn.com/members/opal/" target="_blank">Jet Li</a> posted this over at the SharePoint Team Blog:</p>
<p>&#8220;I am pleased to announce the availability of the first version of the SharePoint 2010 Administration Toolkit. In this toolkit we’ve included a couple of tools that were shipped releases and are now adapted to SharePoint 2010, along with two new tools.&#8221;</p>
<p>The toolkit can be downloaded from here: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=718447d8-0814-427a-81c3-c9c3d84c456e&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyId=718447d8-0814-427a-81c3-c9c3d84c456e&amp;displaylang=en</a></p>
<p>The toolkit documentation can be found here:</p>
<p>SharePoint Foundation 2010: <a href="http://technet.microsoft.com/en-us/library/cc508986.aspx">http://technet.microsoft.com/en-us/library/cc508986.aspx</a></p>
<p>SharePoint Server 2010: <a href="http://technet.microsoft.com/en-us/library/cc508851.aspx">http://technet.microsoft.com/en-us/library/cc508851.aspx</a>  </p>
<p>Read more: <a href="http://blogs.msdn.com/b/sharepoint/archive/2010/07/15/announcing-the-release-of-the-sharepoint-2010-administration-toolkit-v1.aspx">http://blogs.msdn.com/b/sharepoint/archive/2010/07/15/announcing-the-release-of-the-sharepoint-2010-administration-toolkit-v1.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/07/16/microsoft-announces-the-release-of-the-sharepoint-2010-administration-toolkit-v1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Claims Based authentication and the Outlook social connector don&#8217;t work together</title>
		<link>http://stefvanhooijdonk.com/2010/07/14/claims-based-authentication-and-the-outlook-social-connector-dont-work-together/</link>
		<comments>http://stefvanhooijdonk.com/2010/07/14/claims-based-authentication-and-the-outlook-social-connector-dont-work-together/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:04:04 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Claims]]></category>
		<category><![CDATA[#O2010NL]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=612</guid>
		<description><![CDATA[Following the updates on the Outlook social connector and the Facebook plugin for the Outlook social connector there is one little snag! When using a SharePoint 2010 Web Application for your portal/mysites with Claims Based authentication the Outlook social connector cannot connect to it! UPDATE: SP2010 CU1 fixes this! With Fiddler you will see that [...]]]></description>
			<content:encoded><![CDATA[<p>Following the updates on the <a href="http://office.microsoft.com/nl-nl/outlook/lijst-met-outlook-partners-voor-sociale-netwerken-FX101812910.aspx" target="_blank">Outlook social connector </a>and the <a href="http://office.microsoft.com/nl-nl/outlook/lijst-met-outlook-partners-voor-sociale-netwerken-FX101812910.aspx" target="_blank">Facebook plugin for the Outlook social connector </a>there is one little snag!</p>
<p>When using a SharePoint 2010 Web Application for your portal/mysites with Claims Based authentication the Outlook social connector cannot connect to it!</p>
<p>UPDATE: <a href="http://stefvanhooijdonk.com/2010/07/22/sharepoint-2010-and-wss-v4-cumulative-update-1/" target="_blank">SP2010 CU1</a> fixes this!</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/osc-2010-claims-error.png"><img title="osc-2010-claims-error" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/osc-2010-claims-error.png" alt="" width="523" height="246" /></a></p>
<p>With Fiddler you will see that Outlook will try to connect to <a href="http://portal/_vti_bin/Authentication.asmx">http://portal/_vti_bin/Authentication.asmx</a></p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/osc-2010-claims-error-fiddler.png"><img class="alignnone size-full wp-image-614" title="osc-2010-claims-error-fiddler" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/osc-2010-claims-error-fiddler.png" alt="" width="430" height="20" /></a></p>
<p>But this returns a response with the word (ModeResult) &#8220;Forms&#8221;</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/osc-2010-claims-error-fiddler-xml.png"><img class="alignnone size-full wp-image-615" title="osc-2010-claims-error-fiddler-xml" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/osc-2010-claims-error-fiddler-xml.png" alt="" width="563" height="59" /></a></p>
<p>and that&#8217;s why Outlook will show that it cannot connect!</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/osc-2010-claims-error.png"></a></p>
<p> There is a sort 0f solution for this, create a second webapplication, with a separate url, and connect it to the same User Profile Service application as your portal but configure it with windows authentication. Now users can use this second url in their Outlook Social Connector for Sharepoint.</p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/07/14/claims-based-authentication-and-the-outlook-social-connector-dont-work-together/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Usefull tools for Claims Based authentication and SharePoint 2010</title>
		<link>http://stefvanhooijdonk.com/2010/07/14/usefull-tools-for-claims-based-authentication-and-sharepoint-2010/</link>
		<comments>http://stefvanhooijdonk.com/2010/07/14/usefull-tools-for-claims-based-authentication-and-sharepoint-2010/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 09:59:24 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Claims]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=609</guid>
		<description><![CDATA[If you want to create a your own Security Token Service that is compatible with SharePoint 2010 have a look here and download the Windows Identity Foundation (formaly known as Geneva)  SDK: http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&#38;displaylang=en This will install 4 VS 2010 Project Templates on which you can base your Custom STS, I used the first one : Part of a [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to create a your own Security Token Service that is compatible with SharePoint 2010 have a look here and download the Windows Identity Foundation (formaly known as Geneva)  SDK:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504&amp;displaylang=en</a></p>
<p>This will install 4 VS 2010 Project Templates on which you can base your Custom STS, I used the first one :</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/wif-sdk-4.png"><img class="alignnone size-full wp-image-610" title="wif-sdk-4" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/wif-sdk-4.png" alt="" width="426" height="145" /></a></p>
<p>Part of a STS is the WS-Federation Metadata document ( . you can create one for your STS with this tool:</p>
<p><a href="http://weblogs.thinktecture.com/cweyer/2009/05/geneva-based-ws-federation-metadata-document-generation-wizard-or-oops-i-did-it-again.html">http://weblogs.thinktecture.com/cweyer/2009/05/geneva-based-ws-federation-metadata-document-generation-wizard-or-oops-i-did-it-again.html</a></p>
<p>When you want to trust a STS Token Service within your SP2010 Farm you can use this tool:</p>
<p><a href="http://shojeeb.com/sharepoint/sharepoint-federation-utility-spfedutil-exe/" target="_blank">http://shojeeb.com/sharepoint/sharepoint-federation-utility-spfedutil-exe/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/07/14/usefull-tools-for-claims-based-authentication-and-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Claims based authentication and SharePoint 2010 QFE</title>
		<link>http://stefvanhooijdonk.com/2010/07/14/claims-based-authentication-and-sharepoint-2010-qfe/</link>
		<comments>http://stefvanhooijdonk.com/2010/07/14/claims-based-authentication-and-sharepoint-2010-qfe/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 09:33:01 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Claims]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=606</guid>
		<description><![CDATA[When using SharePoint 2010 with a Claims Based Authentication Web Application you will receive an issue in your Central Administration Healt analyser: &#8220;Web Applications using Claims authentication require an update&#8221; Just install this hotfix: http://code.msdn.microsoft.com/KB979917 ( the first recorded SP2010 update? ) More info on the issue: http://technet.microsoft.com/en-us/library/ff686815.aspx]]></description>
			<content:encoded><![CDATA[<p>When using SharePoint 2010 with a Claims Based Authentication Web Application you will receive an issue in your Central Administration Healt analyser:</p>
<p>&#8220;Web Applications using Claims authentication require an update&#8221;</p>
<p>Just install this hotfix: <a href="http://code.msdn.microsoft.com/KB979917">http://code.msdn.microsoft.com/KB979917</a> ( the first recorded SP2010 update? )</p>
<p>More info on the issue: <a href="http://technet.microsoft.com/en-us/library/ff686815.aspx">http://technet.microsoft.com/en-us/library/ff686815.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/07/14/claims-based-authentication-and-sharepoint-2010-qfe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Claims Based authentication and the PublishingCache</title>
		<link>http://stefvanhooijdonk.com/2010/07/06/claims-based-authentication-and-the-publishingcache/</link>
		<comments>http://stefvanhooijdonk.com/2010/07/06/claims-based-authentication-and-the-publishingcache/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 11:07:40 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Claims]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=577</guid>
		<description><![CDATA[If you are using Claims Based Authentication on your WebApplication then the Publishing Cache doesn&#8217;t work properly. Have a look into your Developer Dashboard to see what is going on: The warning and critical error are: 7362 &#8211; Warning Publishing Cache 7363 &#8211; Critical Publishing Cache Why is this? Because with Claims Based Authentication the Cache [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using Claims Based Authentication on your WebApplication then the Publishing Cache doesn&#8217;t work properly.</p>
<p>Have a look into your Developer Dashboard to see what is going on:</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/so2010-dev-dashboard-publishing-cache.png"><img class="alignnone size-full wp-image-578" title="so2010-dev-dashboard-publishing-cache" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/so2010-dev-dashboard-publishing-cache.png" alt="" width="378" height="225" /></a><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/07/so2010-dev-dashboard-publishing-cache.png"></a></p>
<p>The warning and critical error are:</p>
<ul>
<li>7362 &#8211; Warning Publishing Cache</li>
<li>7363 &#8211; Critical Publishing Cache</li>
</ul>
<p>Why is this? Because with Claims Based Authentication the Cache account cannot access the Content Databases.</p>
<p>The <a href="http://technet.microsoft.com/en-us/library/ff758656.aspx" target="_blank">solution</a> is to provide your SPWebApplication with two settings (Properties):</p>
<ul>
<li>portalsuperuseraccount</li>
<li>portalsuperreaderaccount</li>
</ul>
<p>If you are lazy, like me, you probably want to automate this into a PowerShell script:</p>
<p>Update 6 juli 2010: This script sets the default managed account as the portalsuperuseraccount and portalsuperreaderaccount. In a production scenario this will work, but it is wiser to use a read only account. Give this account Full Read permission through a Web Application Policy, follow this <a href="http://technet.microsoft.com/en-us/library/ff758656.aspx" target="_blank">step-by-step-guide</a>.</p>
<pre class="brush: powershell; ruler: true; first-line: 1; toolbar: true;">
write-host ""
write-host -f White "Configure the WebApp property: portalsuperreaderaccount"
write-host ""
write-host -f Green "Stef van Hooijdonk - v1.0"
write-host ""

$snapin="Microsoft.SharePoint.PowerShell"
if (get-pssnapin $snapin -ea "silentlycontinue") {
	write-host -f Green "PSsnapin $snapin is loaded"
}
else {
	if (get-pssnapin $snapin -registered -ea "silentlycontinue") {
		write-host -f Green "PSsnapin $snapin is registered"
		Add-PSSnapin $snapin
		write-host -f Green "PSsnapin $snapin is loaded"
	}
	else {
		write-host -f Red "PSSnapin $snapin not found"
	}
}

write-host -f Green "Getting current Farm"
$farm = Get-SPFarm

write-host -f Green "Getting Default ServiceAccount (Managed)"
$cacheAccount= $farm.DefaultServiceAccount.Name

write-host ""
write-host -f Green "Going to loop Claims Based authentication WebApplications"
write-host ""

Get-SPWebApplication | foreach-object {

	if ($_.UseClaimsAuthentication ) {
	write-host -f white $_.Url " is a Claims Based Authentication WebApp"

	write-host -f yellow " - Setting Property: portalsuperuseraccount $cacheAccount for" $_.Url
	$_.Properties["portalsuperuseraccount"] = "$cacheAccount"

	write-host -f yellow " - Setting Property: portalsuperreaderaccount $cacheAccount for" $_.Url
	$_.Properties["portalsuperreaderaccount"] = "$cacheAccount"

	$_.Update()
	write-host "Saved properties"
	}

}
Write-host ""
Write-host -f red "Going to run IISReset"
Write-host ""
IISreset /noforce
Write-host ""</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/07/06/claims-based-authentication-and-the-publishingcache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simultaneous Editing in Office 2010 Web Apps: Only in Excel and OneNote</title>
		<link>http://stefvanhooijdonk.com/2010/06/25/simultaneous-editing-in-office-2010-web-apps-only-in-excel/</link>
		<comments>http://stefvanhooijdonk.com/2010/06/25/simultaneous-editing-in-office-2010-web-apps-only-in-excel/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 15:03:52 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=573</guid>
		<description><![CDATA[Thought that this was a Major feature for the Office 2010 Web Apps. But it did not make it in the final bits for PowerPoint and Word. &#8220;Simultaneous editing for collaboration is one of the most hyped features in Office 2010, however it’s only supported over the web in the Excel 2010 web app.  For Word [...]]]></description>
			<content:encoded><![CDATA[<p>Thought that this was a Major feature for the Office 2010 Web Apps. But it did not make it in the final bits for PowerPoint and Word.</p>
<p>&#8220;Simultaneous editing for collaboration is one of the most hyped features in Office 2010, however it’s only supported over the web in the Excel 2010 web app.  For Word and PowerPoint simultaneous editing, you’ll need to have the full client versions of the Office 2010 products.  This will likely be a disappointment for people who were hoping to collaborate on documents from kiosks anywhere in the world.&#8221; (<a title="Posts by Michael Fettner" href="http://blogs.kraftkennedy.com/index.php/author/fettner/">Michael Fettner</a>)</p>
<p>Go over to <a href="http://blogs.kraftkennedy.com/index.php/2010/03/08/simultaneous-editing-in-office-2010-web-apps-only-in-excel/" target="_blank">his blog </a>for the details.</p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/06/25/simultaneous-editing-in-office-2010-web-apps-only-in-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Login troubles with Word and SharePoint?</title>
		<link>http://stefvanhooijdonk.com/2010/06/23/login-troubles-with-word-and-sharepoint/</link>
		<comments>http://stefvanhooijdonk.com/2010/06/23/login-troubles-with-word-and-sharepoint/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 11:11:53 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=567</guid>
		<description><![CDATA[Symptom: do users complain that they need to login over and over when opening and saving word documents on your SharePoint ( MOSS2007 /SP2010 ) portal? Then you probably have used a FQDN for your portal url. The fix is quite easy if you have Vista or Windows 7 clients: http://support.microsoft.com/?id=943280 Short version: Add a [...]]]></description>
			<content:encoded><![CDATA[<p>Symptom: do users complain that they need to login over and over when opening and saving word documents on your SharePoint ( MOSS2007 /SP2010 ) portal?</p>
<p>Then you probably have used a FQDN for your portal url.</p>
<p>The fix is quite easy if you have Vista or Windows 7 clients:</p>
<p><a href="http://support.microsoft.com/?id=943280">http://support.microsoft.com/?id=943280</a></p>
<p>Short version:</p>
<p>Add a reg key to &#8220;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters&#8221;</p>
<p>with the name: <strong>AuthForwardServerList</strong> (MULTI_STRING) and add your portal urls as values:</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/login-troubles-solution.png"><img class="alignnone size-full wp-image-568" title="login troubles solution" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/login-troubles-solution.png" alt="" width="367" height="182" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/06/23/login-troubles-with-word-and-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing Unit Testing with TFS2010 and SP2010</title>
		<link>http://stefvanhooijdonk.com/2010/06/22/doing-unit-testing-with-tfs2010-and-sp2010/</link>
		<comments>http://stefvanhooijdonk.com/2010/06/22/doing-unit-testing-with-tfs2010-and-sp2010/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 08:00:12 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[TFS 2010]]></category>
		<category><![CDATA[Team Foundation Server]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=504</guid>
		<description><![CDATA[SharePoint 2010 has a wonderfull new developers experience with Visual Studio 2010 and great integration with Team Foundation Server 2010. We configured our TFS Build server to build our SP2010 solutions fairly easy. Just make sure the SP2010 dll&#8217;s you reference in your SP2010 projects are available on the TFS Build Server (in the GAC [...]]]></description>
			<content:encoded><![CDATA[<p>SharePoint 2010 has a wonderfull new developers experience with Visual Studio 2010 and great integration with Team Foundation Server 2010. We configured our TFS Build server to build our SP2010 solutions fairly easy. Just make sure the SP2010 dll&#8217;s you reference in your SP2010 projects are available on the TFS Build Server (in the GAC makes it very easy).</p>
<p>But one thing is not possible, and that is using the Test Projects with your SP2010 projects. Why? because Microsoft did not implement testing with .Net framework 3.5 and below. You can only use the Test projects in VS2010 (and thus in TFS2010) with 4.0 Framework projects. And so you cannot use the Unit test in VS2010 either.</p>
<p>But you can fairly easy use the <a href="http://www.nunit.org/" target="_blank">Nunit 2 framework</a> with VS2010 and TFS2010. Head over to this codeplex project: <a href="http://nunit4teambuild.codeplex.com/" target="_blank">http://nunit4teambuild.codeplex.com/</a> and you can now have 3.5 Framework NUnit tests with TFS2010. And your Unittest results even show up in TFS2010 build reports!</p>
<p>So how to get NUnit to test your SP2010 projects? Install SP2010 on your TFS Build Agent! You can then deploy your solutions on the build server, perform unit tests, and then remove your solutions again.</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/tfs-overview.png" target="_blank"><img class="size-full wp-image-507 alignnone" title="tfs-overview" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/tfs-overview.png" alt="" width="450" height="244" /></a></p>
<p>Individual test results:<br />
<a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/tfs-unittesting.png"><img class="size-full wp-image-508 alignnone" title="tfs-unittesting" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/tfs-unittesting.png" alt="" width="442" height="151" /></a><br />
So what do you need:</p>
<p>- VS 2010 solution with one or more SP2010 projects and at least one NUnit Test project<br />
- TFS Build Agent with SP2010 installed and configured<br />
- A web application for this solution we want to build ( store the web application url in your tfsbuild.proj )<br />
- a deployment script ( powershell off course ) that can be used on you dev server, the Build Agent server (farm) and other farms<br />
- a removal script ( powershell also ) that clears your deployment again<br />
- a tfsbuild.proj that builds, packages and runs the nunit ( see below )<br />
- XSLT to transform NUnit test results to MSTest test results</p>
<p>A powershell script to deploy a solution can be <a href="http://stefvanhooijdonk.com/2010/04/06/powershell-and-sp2010-2-installing-a-solution/" target="_blank">found here</a><br />
So here is a small overview of my tfsbuild.proj:</p>
<p>- build the solution/projects<br />
- package the projects that are sp2010 projects ( this makes the wsp packages ! )<br />
- run a powershell deployment script<br />
- run nunit against your test project<br />
- run a powershell removal script<br />
- convert the nunit result xml to TFS / MSTest format with xslt ( see codeplex link above )<br />
- upload the nunit transformed test results to tfs with MSTest<br />
- zip the solutions with the scripts<br />
- upload the zip to a location where you can use it on the test environment</p>
<p>Example NUnit code:</p>
<pre style="background-color:#3030f0;color:#f0f0f0;overflow:scroll;">        [Test]
        [Category("Features")]
        public void TestFeatures() {
            Assert.IsNotNull(this.projectName, "No valid ProjectName found.");
            Assert.IsNotNull(this.webapp, "No valid Test WebApplication is found.");
            Assert.IsNotNull(this.testsite, "No valid Test Site Collection is found.");

            try {
                //string contenttypes_id = "03ec908f-fc7a-44cf-a8fc-bc3b9d9896de";
                //string trefwoorden_id = "f0455e8e-aa5d-4ae7-8af9-a97947f7e3a0";
                string webparts_id = "f0e1d4d6-2694-479f-8751-9704818f1464";

                SPFeature feature = this.testsite.Features[new Guid(webparts_id)];
                Assert.IsNotNull(feature, "webparts_feature not found active.");

                // check if the webparts are present in the WebPart Gallery

            }
            catch (Exception exc) {
                Assert.Fail(exc.Message);
            }
        }</pre>
<p>You can download exmple scripts and proj files here:<br />
<a href="http://stefvanhooijdonk.codeplex.com/releases/view/47332" target="_blank">Codeplex &#8220;release&#8221; for this blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/06/22/doing-unit-testing-with-tfs2010-and-sp2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Document ID Provider, the last one?</title>
		<link>http://stefvanhooijdonk.com/2010/06/21/document-id-provider-the-last-one/</link>
		<comments>http://stefvanhooijdonk.com/2010/06/21/document-id-provider-the-last-one/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 10:49:17 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=527</guid>
		<description><![CDATA[For a client of ours we wanted to create a Custom SP2010 Document ID Provider. For this provider I wanted to be able to adjust and configure it so I can use it for other customers also. First I needed to know how to create a Document ID Provider and found that: Tobias Zimmergren had [...]]]></description>
			<content:encoded><![CDATA[<p>For a client of ours we wanted to create a Custom SP2010 Document ID Provider. For this provider I wanted to be able to adjust and configure it so I can use it for other customers also.<br />
First I needed to know how to create a Document ID Provider and found that: <a href="http://www.zimmergren.net/" target="_blank">Tobias Zimmergren</a> had an <a href="http://www.zimmergren.net/archive/2010/04/13/sp-2010-sharepoint-server-2010-creating-your-custom-document-id-provider.aspx" target="_blank">excelent article</a> on creating you own <a href="http://msdn.microsoft.com/en-us/library/ee559302(office.14).aspx" target="_blank">SP2010 Document ID Provider</a>.</p>
<p>Next in order to create a unique sequenced number I immediatly thought of SQL Server. And found that <a href="http://www.tonstegeman.com/Blog" target="_blank">Ton Stegeman</a> had an equally <a href="http://www.tonstegeman.com/Blog/Lists/Posts/Post.aspx?List=70640fe5%2D28d9%2D464f%2Db1c9%2D91e07c8f7e47&amp;ID=120" target="_blank">usefull post</a> on how to create <a href="http://www.tonstegeman.com/Blog/Lists/Posts/Post.aspx?List=70640fe5%2D28d9%2D464f%2Db1c9%2D91e07c8f7e47&amp;ID=120" target="_blank">your own SPDatabase object in a SharePoint Farm</a>.</p>
<p>Now I was set to create &#8220;the last Document ID Provider&#8221; for SP2010 I was ever going to write. Perhaps not but still, it should suffice for a LOT of clients of us!</p>
<p>I wanted to end up with an admin page like this:<br />
<a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/custom-documentid-provider.png"><img class="alignleft size-full wp-image-532" title="custom-documentid-provider" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/custom-documentid-provider.png" alt="" width="630" height="387" /></a><br />
<br style="clear: all;" /><br />
This should then result in this document id:<br />
<a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/custom-documentid-provider-example.png"><img class="alignleft size-full wp-image-534" title="custom-documentid-provider-example" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/custom-documentid-provider-example.png" alt="" width="360" height="298" /></a><br />
<br style="clear: all;" /><br />
So how to do this?<br />
<strong>Step 1</strong><br />
Create a Database with a Table where I can store my generated document id&#8217;s</p>
<pre class="brush: sql; ruler: true; first-line: 1; toolbar: true;">CREATE TABLE [dbo].[scoped_docid](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[scopeid] [uniqueidentifier] NOT NULL,
	[objectid] [uniqueidentifier] NOT NULL,
	[scopedocid] [bigint] NULL,
	[scope] [varchar](100) NULL,
	[generateddocid] [varchar](150) NULL,
	[listid] [uniqueidentifier] NULL,
	[webid] [uniqueidentifier] NULL,
	[siteid] [uniqueidentifier] NULL,
	[webapplicationid] [uniqueidentifier] NULL,
	[farmid] [uniqueidentifier] NULL,
	[created] [datetime] NULL,
	CONSTRAINT [PK_scoped_docid] PRIMARY KEY CLUSTERED
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]</pre>
<p>And a stored procedure to Get/Insert ID&#8217;s:</p>
<pre class="brush: sql; ruler: true; first-line: 1; toolbar: true;">-- =============================================
-- Author:		Stef van Hooijdonk
-- Create date: juni 2010
-- Description:
-- =============================================
CREATE PROCEDURE GetNextScopedDocID
	-- Add the parameters for the stored procedure here

	@scopeid uniqueidentifier  ,
	@scope varchar(100),
	@itemid uniqueidentifier
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

	BEGIN TRANSACTION

	declare @result bigint
	declare @scopedindex bigint

	select @scopedindex=COALESCE([scopedocid],-1),@result=[id] from scoped_docid where [objectid] = lower(@itemid)

	if (@scopedindex is null)  begin
		-- coalesce for the first record will have MAX = null, and then we add 1
		select @scopedindex=COALESCE(MAX(scopedocid),0)+1 from scoped_docid where scope = lower(@scope)

		insert into [scoped_docid] (scopeid ,scope,objectid, scopedocid ) values( lower(@scopeid), lower(@scope),LOWER( @itemid), @scopedindex)
		select @result = SCOPE_IDENTITY()
	end
	COMMIT
	select @result as record,@scopedindex as docid
END
GO</pre>
<p>There is more to it than this, but you can check out the downloads for all the details.<br />
<strong>Step 2</strong><br />
Create an SPDatabase object for this Database, see the Ton Stegeman post!</p>
<p><strong>Step 3</strong><br />
Create a Document ID Provider that uses this SPDatabase and generates Document ID&#8217;s based on some settings. What I did was generate the sequenced number in SQL and then format that in a method with the other variables. Generating a YEAR or DAY into a string is fairly easy.</p>
<p><strong>Step 4</strong><br />
Create an Central Admin page to change the settings of our Document ID Provider ( see screenshot ).<br />
You can use the SPFarm.Local.Properties to score your settings Farm Wide:</p>
<pre class="brush: c#; ruler: true; first-line: 1; toolbar: true;">/// &lt;summary&gt;
/// The default farm wide scope setting for this DocumentProvider
/// &lt;/summary&gt;
public ProviderScope Scope {
  get {
    ProviderScope result = ProviderScope.Farm;
    try {
      string setting = Settings.GetFarmSetting("CustomDocumentIDProvider.Scope");
      if (!string.IsNullOrEmpty(setting))
        result = (ProviderScope)Enum.Parse(typeof(ProviderScope), setting);
      }
    }
    catch (Exception exc) {
      LogException(exc);
    }
    return result;
  }
  set {
    Settings.SetFarmSetting("CustomDocumentIDProvider.Scope", value.ToString());
  }
}</pre>
<p>The scope:</p>
<pre class="brush: c#; ruler: true; first-line: 1; toolbar: true;">/// &lt;summary&gt;
/// Scopes for the Document ID Provider
/// &lt;/summary&gt;
public enum ProviderScope {
	/// &lt;summary&gt;Farm wide scope&lt;/summary&gt;
        Farm=1,
        /// &lt;summary&gt;Webapplication scope&lt;/summary&gt;
        Webapplication = 2,
        /// &lt;summary&gt;SPSite/Site collection scope&lt;/summary&gt;
        SiteCollection = 3,
        /// &lt;summary&gt;Site/Subweb (SPWeb) scope&lt;/summary&gt;
        Site = 4,
        /// &lt;summary&gt;List scope&lt;/summary&gt;
        List = 5,
        /// &lt;summary&gt;No scope&lt;/summary&gt;
        None = 100
}</pre>
<p><strong>Downloads</strong><br />
<a href="http://stefvanhooijdonk.codeplex.com/releases/view/47551#DownloadId=128309" target="_blank">Download solution</a><br />
<a href="http://stefvanhooijdonk.codeplex.com/releases/view/47551" target="_blank">Download sources</a></p>
<p><strong>How to use the solution</strong></p>
<ul>
<li>Install solution</li>
<li>Navigate to Central Admin. and go to General Application Settings</li>
<li>Navigate to the <a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/docid-farm-admin.png" target="_blank">Document ID Farm Administration</a> page below the Tam Tam section</li>
<li>Supply a Database name for your Farm wide document ID provider and press provision</li>
<li><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/docid-farm-admin-2.png" target="_blank">Supply</a> the settings and formatstring</li>
<li>Navigate to your site collection and <a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/06/docid-farm-feature.png" target="_blank">activate the Tam Tam Document ID Provider</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/06/21/document-id-provider-the-last-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small Powershell scripting tip</title>
		<link>http://stefvanhooijdonk.com/2010/06/16/small-powershell-scripting-tip/</link>
		<comments>http://stefvanhooijdonk.com/2010/06/16/small-powershell-scripting-tip/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 19:35:21 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=517</guid>
		<description><![CDATA[Want to log the output of your powershell script? use &#8220;Start-Transcript&#8221;! Top of your powershell script: ## Start logging $LogTime = Get-Date -Format yyyy-MM-dd_h-mm $LogFile = "$env:USERPROFILE\Desktop\Deploy-$LogTime.rtf" Start-Transcript -Path $LogFile -Force and put this at the end of your script: Stop-Transcript Invoke-Item $LogFile]]></description>
			<content:encoded><![CDATA[<p>Want to log the output of your powershell script?<br />
use &#8220;Start-Transcript&#8221;!</p>
<p>Top of your powershell script:</p>
<pre style="background-color:#3030f0;color:#f0f0f0;overflow:scroll;">
## Start logging
$LogTime = Get-Date -Format yyyy-MM-dd_h-mm
$LogFile = "$env:USERPROFILE\Desktop\Deploy-$LogTime.rtf"
Start-Transcript -Path $LogFile -Force
</pre>
<p>and put this at the end of your script:</p>
<pre style="background-color:#3030f0;color:#f0f0f0;overflow:scroll;">
Stop-Transcript
Invoke-Item $LogFile
</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/06/16/small-powershell-scripting-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone and SharePoint</title>
		<link>http://stefvanhooijdonk.com/2010/06/04/iphone-and-sharepoint-2/</link>
		<comments>http://stefvanhooijdonk.com/2010/06/04/iphone-and-sharepoint-2/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 18:02:49 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>

		<guid isPermaLink="false">https://stefvanhooijdonkblog.wordpress.com/2010/06/04/iphone-and-sharepoint-2/</guid>
		<description><![CDATA[Want SharePoint on your iPhone? Moshare for the iPhone is available for free now in the App Store. http://itunes.apple.com/us/app/moshare-a-sharepoint-client/id363305511?mt=8]]></description>
			<content:encoded><![CDATA[<p>Want SharePoint on your iPhone?<br />
Moshare for the iPhone is available for free now in the App Store.</p>
<p>http://itunes.apple.com/us/app/moshare-a-sharepoint-client/id363305511?mt=8</p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/06/04/iphone-and-sharepoint-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SP2010 SDK available for download</title>
		<link>http://stefvanhooijdonk.com/2010/05/21/sp2010-sdk-available-for-download/</link>
		<comments>http://stefvanhooijdonk.com/2010/05/21/sp2010-sdk-available-for-download/#comments</comments>
		<pubDate>Fri, 21 May 2010 08:19:17 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#SP2010NL]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=488</guid>
		<description><![CDATA[Saw this on twitter a couple of times, the SP2010, SharePoint 2010 Foundation and Server SDK is available for download over at microsoft.com: http://www.microsoft.com/downloads/details.aspx?displaylang=en&#38;FamilyID=f0c9daf3-4c54-45ed-9bde-7b4d83a8f26f]]></description>
			<content:encoded><![CDATA[<p>Saw this on twitter a couple of times, the SP2010, SharePoint 2010 Foundation and Server SDK is available for download over at microsoft.com:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=f0c9daf3-4c54-45ed-9bde-7b4d83a8f26f">http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=f0c9daf3-4c54-45ed-9bde-7b4d83a8f26f</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/05/21/sp2010-sdk-available-for-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set default Mysite not working with Office 2010 RTM x64</title>
		<link>http://stefvanhooijdonk.com/2010/05/21/set-default-mysite-not-working-with-office-2010-rtm-x64/</link>
		<comments>http://stefvanhooijdonk.com/2010/05/21/set-default-mysite-not-working-with-office-2010-rtm-x64/#comments</comments>
		<pubDate>Fri, 21 May 2010 08:08:26 +0000</pubDate>
		<dc:creator>Stef van Hooijdonk</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[#O2010NL]]></category>
		<category><![CDATA[#SP2010NL]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://stefvanhooijdonk.com/?p=484</guid>
		<description><![CDATA[So, you have installed SharePoint 2010 on your server, you have setup Office 2010 on you client ( x64 ) and now you want your SP2010 Memberships to show up in your Office Client Applications. You navigate to your new SP2010 MySite and want to set it as your default MySite for your office 2010 [...]]]></description>
			<content:encoded><![CDATA[<p>So, you have installed SharePoint 2010 on your server, you have setup Office 2010 on you client ( x64 ) and now you want your SP2010 Memberships to show up in your Office Client Applications.</p>
<p>You navigate to your new SP2010 MySite and want to set it as your default MySite for your office 2010 applications.</p>
<p>But the popup does not come up?</p>
<p>That is because SP2010 ( Office 14 ! ) want&#8217;s to activate the ActiveX control &#8220;PortalConnect12.PersonalSite&#8221;. That is the OFfice 2007 ActiveX control! No wonder it doesn&#8217;t work!</p>
<p>The ActiveX control &#8220;PortalConnect12.PersonalSite&#8221; ( {E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5} )  is present on your system but it registerd itself as the &#8220;PortalConnect14.PersonalSite&#8221; ActiveX control.</p>
<p>If you run this Registry fix it will start to work again!</p>
<pre style="color:white;background-color:black;overflow:auto;">
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}]
@="PersonalSite Class"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Portal\\PortalConnectCore.dll"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}\ProgID]
@="PortalConnect14.PersonalSite.1"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}\Programmable]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}\TypeLib]
@="{CA973FCA-E9C3-4B24-B864-7218FC1DA7BA}"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}\VersionIndependentProgID]
@="PortalConnect14.PersonalSite"

[HKEY_CLASSES_ROOT\PortalConnect12.PersonalSite]
@="PersonalSite Class"

[HKEY_CLASSES_ROOT\PortalConnect12.PersonalSite\CLSID]
@="{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}"

[HKEY_CLASSES_ROOT\PortalConnect12.PersonalSite\CurVer]
@="PortalConnect12.PersonalSite.1"

[HKEY_CLASSES_ROOT\PortalConnect12.PersonalSite.1]
@="PersonalSite Class"

[HKEY_CLASSES_ROOT\PortalConnect12.PersonalSite.1\CLSID]
@="{E7339A62-0E31-4A5E-BA3D-F2FEDFBF8BE5}"</pre>
<p>And now when you open your SP2010 MySite:</p>
<p><a href="http://stefvanhooijdonk.com/wp-content/uploads/2010/05/sp2010-mysite.png"><img class="alignnone size-full wp-image-490" title="sp2010-mysite" src="http://stefvanhooijdonk.com/wp-content/uploads/2010/05/sp2010-mysite.png" alt="" width="450" height="180" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stefvanhooijdonk.com/2010/05/21/set-default-mysite-not-working-with-office-2010-rtm-x64/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
