<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blog.michelbarneveld.nl/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Michel Barneveld's Blog</title><link>http://blog.michelbarneveld.nl/michel/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>WaitForWspJob Tool</title><link>http://blog.michelbarneveld.nl/michel/archive/2010/04/05/waitforwspjob-tool.aspx</link><pubDate>Mon, 05 Apr 2010 12:08:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:5625</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=5625</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=5625</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2010/04/05/waitforwspjob-tool.aspx#comments</comments><description>&lt;p&gt;WaitForWspJob.exe is a tool for SharePoint 2007&amp;nbsp;that will wait for the Admin Service&amp;nbsp;to finish the deployment or retraction of a SharePoint solution (wsp). Download page: &lt;a href="http://blog.michelbarneveld.nl/media/p/5623.aspx"&gt;http://blog.michelbarneveld.nl/media/p/5623.aspx&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;The tool accepts the solution file name or the solution id (guid) and you can give it a timeout value. By default it waits 5 minutes for the solutiion job to finish before it returns control.&lt;/p&gt;
&lt;p style="PADDING-LEFT:30px;"&gt;Usage:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WaitForWspJob.exe &amp;lt;wsp&amp;gt; [&amp;lt;timeout&amp;gt;]&lt;/p&gt;
&lt;p style="PADDING-LEFT:30px;"&gt;Arguments:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wsp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The name or guid of the SharePoint solution&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timeout&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum wait time in minutes. Default: 5&lt;/p&gt;
&lt;p style="PADDING-LEFT:30px;"&gt;Examples:&lt;br /&gt;WaitForWspJob.exe ExampleSharePointSolution.wsp&lt;br /&gt;WaitForWspJob.exe ExampleSharePointSolution.wsp 10&lt;br /&gt;WaitForWspJob.exe 3ce2bc5d-69b2-47bd-bd89-80d138f4faba&lt;/p&gt;
&lt;h2&gt;Why do you need it&lt;/h2&gt;
&lt;p&gt;Well, you don&amp;#39;t have to use it ;-)&amp;nbsp;There are other good (GUI) SharePoint solution installers available or you can even use the Solution Management screens in Central Admin or the STSADM commands. But when working with batchfiles and deploying/retracting solutions you might run into errors/weird behaviour. I wrote this tool in&amp;nbsp;a few minutes&amp;nbsp;to solve my issues with deployments with batchscripts.&lt;/p&gt;
&lt;p&gt;After&amp;nbsp;deploying or retracting a SharePoint solution, you have to wait till the&amp;nbsp;Admin&amp;nbsp;service has executed the jobs&amp;nbsp;to deploy/retract the solution, before you can delete the solution (in case of retract scenario)&amp;nbsp;or activate the features in the solution (deploy scenario). &lt;br /&gt;Otherwise you will get an error like in below example of deleting the solution directly after retracting it.&lt;/p&gt;
&lt;div style="background-color:Black;color:White;float:left;font-family:Courier New;font-weight:normal;font-size:small;"&gt;
&lt;p&gt;D:\&amp;gt;stsadm -o retractsolution -name Sample_Solution_v1.0.wsp -allcontenturls -im&lt;br /&gt;mediate&lt;br /&gt;&lt;br /&gt;Timer job successfully created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D:\&amp;gt;stsadm -o deletesolution -name Sample_Solution_v1.0.wsp&lt;br /&gt;&lt;br /&gt;The solution &amp;quot;Sample_Solution_v1.0.wsp&amp;quot; has been deployed in the farm. Please re&lt;br /&gt;tract the deployment before removing the solution.You can also use the -override&lt;br /&gt;parameter to forcibly remove the solution, but you will not be able to retract&lt;br /&gt;the solution deployment.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br clear="all" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;You can force running the jobs by executing the &lt;strong&gt;&lt;em&gt;STSADM&lt;/em&gt;&lt;/strong&gt; command &lt;strong&gt;&lt;em&gt;ExecAdmSvcJobs&lt;/em&gt;&lt;/strong&gt;, however that &lt;strong&gt;&lt;em&gt;STSADM&lt;/em&gt;&lt;/strong&gt; operation doesn&amp;#39;t check if the Admin Service is also running that solution job. So most of the times the job gets executed twice at the same time! This can lead to all kinds of problems. In the deployment scripts I was working on a few weeks ago, this&amp;nbsp;resulted in solutions that&amp;nbsp;couldn&amp;#39;t be deployed because they were already deployed according to STSADM, however the Solution Management in Central Admin&amp;nbsp;showed them as not deployed!?!&amp;nbsp;You can use the &lt;em&gt;&lt;strong&gt;-&lt;/strong&gt;force&lt;/em&gt; parameter in such a case, but I only want to do that&amp;nbsp;if nothing else works.&lt;/p&gt;
&lt;p&gt;Using the ExecAdmSvcJobs after a deployment can lead to messages like: &lt;strong&gt;&lt;em&gt;&amp;quot;The job completed successfully, but could not be properly cleaned up.&amp;nbsp; This job may execute again on this server.&amp;quot;&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;Like in this example:&lt;/p&gt;
&lt;div style="background-color:Black;color:White;float:left;font-family:Courier New;font-weight:normal;font-size:small;"&gt;
&lt;p&gt;D:\&amp;gt;stsadm -o deploysolution -name Sample_Solution_v1.0.wsp -url http://sp07dev&lt;br /&gt;-immediate -allowgacdeployment&lt;br /&gt;&lt;br /&gt;Timer job successfully created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D:\&amp;gt;stsadm -o execadmsvcjobs&lt;br /&gt;&lt;br /&gt;Executing .&lt;br /&gt;Executing solution-deployment-sample_solution_v1.0.wsp-0.&lt;br /&gt;The solution-deployment-sample_solution_v1.0.wsp-0 job completed successfully, b&lt;br /&gt;ut could not be properly cleaned up. This job may execute again on this server.&lt;br /&gt;&lt;br /&gt;Operation completed successfully.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br clear="all" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;When you get a message as above you can also see that the job was executed twice in the Solution Manager in Central Admin. The message that the solution was deployed is shown twice!&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Duplicate-deployment-message.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Duplicate-deployment-message.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My solution was simple: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make sure that the Admin Service is running&lt;/li&gt;
&lt;li&gt;Don&amp;#39;t use the &lt;em&gt;STSADM&lt;/em&gt; command &lt;em&gt;ExecAdmSvcJobs&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Use WaitForWspJob.exe to wait for the jobs to finish before executing any other command&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example usage in a script:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;stsadm -o retractsolution -name Sample_Solution_v1.0.wsp -allcontenturls -immediate&lt;br /&gt;WaitForWspJob.exe Sample_Solution_v1.0.wsp&lt;br /&gt;stsadm -o deletesolution -name Sample_Solution_v1.0.wsp&lt;/p&gt;
&lt;p&gt;Example output:&lt;/p&gt;
&lt;div style="background-color:Black;color:White;float:left;font-family:Courier New;font-weight:normal;font-size:small;"&gt;
&lt;p&gt;D:\&amp;gt;stsadm -o retractsolution -name Sample_Solution_v1.0.wsp -allcontenturls -im&lt;br /&gt;mediate&lt;br /&gt;&lt;br /&gt;Timer job successfully created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D:\&amp;gt;WaitForWspJob.exe Sample_Solution_v1.0.wsp&lt;br /&gt;Solution (Sample_Solution_v1.0.wsp) found in the solution store.&lt;br /&gt;Wating for solution job to finish&lt;br /&gt;...................&lt;br /&gt;Solution job finished!&lt;br /&gt;Last Operation Result: RetractionSucceeded&lt;br /&gt;&lt;br /&gt;D:\&amp;gt;stsadm -o deletesolution -name Sample_Solution_v1.0.wsp&lt;br /&gt;&lt;br /&gt;Operation completed successfully.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br clear="all" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Internals of the tool&lt;/h2&gt;
&lt;p&gt;So how does the tool determine if there is still a job running?&lt;/p&gt;
&lt;p&gt;You can get a &lt;span style="color:#2b91af;"&gt;&lt;span style="color:#2b91af;"&gt;SPSolution &lt;/span&gt;&lt;/span&gt;object to your solution from the solution collection from &lt;span&gt;&lt;span style="color:#2b91af;"&gt;&lt;span style="color:#2b91af;"&gt;SPFarm&lt;/span&gt;&lt;/span&gt;.Local.Solutions. The &lt;span style="color:#2b91af;"&gt;SPSolution &lt;/span&gt;&lt;span style="color:#000000;"&gt;has a property &lt;strong&gt;&lt;em&gt;JobExists&lt;/em&gt;&lt;/strong&gt; that returns true if there is still a job running or waiting.&lt;br /&gt;There is also a property &lt;strong&gt;&lt;em&gt;JobStatus&lt;/em&gt;&lt;/strong&gt;, but be carefull when you use it, because it will throw an exception the moment the job is finished.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So the tool is nothing more than a loop checking for the &lt;em&gt;JobExists &lt;/em&gt;property to go false. In short:&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#2b91af;"&gt;&lt;span style="color:#2b91af;"&gt;SPSolution&lt;/span&gt;&lt;/span&gt;&lt;span&gt; wsp = &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;&lt;span style="color:#2b91af;"&gt;SPFarm&lt;/span&gt;&lt;/span&gt;.Local.Solutions[wspNameOrGuid];&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span&gt; (wsp.JobExists)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Threading.&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;&lt;span style="color:#2b91af;"&gt;Thread&lt;/span&gt;&lt;/span&gt;.Sleep(1000);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;The &lt;span style="color:#2b91af;"&gt;SPSolution &lt;/span&gt;class has also properties to determine if the job went successful or not: &lt;strong&gt;&lt;em&gt;LastOperationResult, LastOperationDate &lt;/em&gt;&lt;/strong&gt;and &lt;strong&gt;&lt;em&gt;LastOperationDetails&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Full source is downloadable at: &lt;a href="http://blog.michelbarneveld.nl/media/p/5624.aspx"&gt;http://blog.michelbarneveld.nl/media/p/5624.aspx&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=5625" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Kerberos Authentication Tester</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/12/05/kerberos-authentication-tester.aspx</link><pubDate>Sat, 05 Dec 2009 20:25:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:36</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=36</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=36</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/12/05/kerberos-authentication-tester.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Detailed.png"&gt;&lt;/a&gt;Quite often I am wondering if a site is using Kerberos or NTLM. You can use tools like Fiddler, Network Monitor and such for that. But sometimes I just want to have a simple tool without installation like when working on computers where you can&amp;#39;t install such software but are allowed to run executables. For that I have created a tool: &lt;strong&gt;&lt;a target="_blank" href="http://blog.michelbarneveld.nl/media/p/33.aspx"&gt;Kerberos Authentication Tester&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kerberos Authentication Tester Features:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It shows what authentication method is used in a web request: None, Basic, NTLM or Kerberos&lt;/li&gt;
&lt;li&gt;It shows the SPN used in case of Kerberos&lt;/li&gt;
&lt;li&gt;It shows the HTTP status&lt;/li&gt;
&lt;li&gt;It shows the HTTP Headers of the request.&lt;/li&gt;
&lt;li&gt;It shows the version of NTLM used (v1 or v2)&lt;/li&gt;
&lt;li&gt;It has a detailed view with a complete breakdown of the Authorization header. (Yep, went through all the RFCs to dissect the Kerberos and NTLM packages)&lt;/li&gt;
&lt;li&gt;It shows your current Kerberos tickets and allows you to remove them (like klist.exe)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Some Screen shots:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The main form:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Test.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Test.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The blue &lt;em&gt;details&lt;/em&gt; link at the top right shows a new screen with the details of the request, including a breakdown of the Authorization HTTP Header. You can also save this XML.&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Detailed.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Detailed.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Use different credentials or a proxy:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Settings.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Settings.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And it also has quick access to the Kerberos Ticket of the current users. And you can even delete them.&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Tickets.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Kerberos-Authentication-Tester-_2D00_-Tickets.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s still in beta, so your mileage may vary ;-) &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=36" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Security/default.aspx">Security</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Tools/default.aspx">Tools</category></item><item><title>How to create a custom DocumentIdProvider for SharePoint 2010 (including source code)</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/12/05/how-to-create-a-custom-documentidprovider-for-sharepoint-2010.aspx</link><pubDate>Sat, 05 Dec 2009 12:49:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:34</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=34</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=34</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/12/05/how-to-create-a-custom-documentidprovider-for-sharepoint-2010.aspx#comments</comments><description>&lt;p&gt;[4/26/2010] Updated with interface changes from beta2 to rtm&lt;/p&gt;
&lt;p&gt;In SharePoint 2010 there is a new feature called the &lt;strong&gt;Document ID&lt;/strong&gt;. When that feature is enabled, it will assign an unique ID and a permanent url to the document in a document library. Documents can be found using that Document ID, even if the document is moved to another location within the document library, site, or farm.&lt;/p&gt;
&lt;p&gt;The default structure of the DocumentID is:&amp;nbsp;&amp;lt;PrefixString&amp;gt;-&amp;lt;ListId&amp;gt;-&amp;lt;ListItemId&amp;gt; &lt;br /&gt;Example: &lt;strong&gt;E2E4NK52YQC4-2-4&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That prefix string is created as a unique string for every Site Collection. The first way to customize the DocumentID is to use the &lt;strong&gt;&lt;em&gt;Document ID Settings &lt;/em&gt;&lt;/strong&gt;page in &lt;strong&gt;&lt;em&gt;Site Settings&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;In this page you can change the prefix string:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/DocIdSettings.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document_5F00_ID_5F00_Settings.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document_5F00_ID_5F00_Settings.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But if that is not enough customization, there is also an other way: Your own DocumentIDProvider implementation.&lt;/p&gt;
&lt;p&gt;Just derive your class from the abstract class &lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;Microsoft.Office.DocumentManagement.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;DocumentIdProvider &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;and implement 1 property and 3 methods,&lt;/p&gt;
&lt;p&gt;But before we take a look at the methods we need to implement, let&amp;#39;s&amp;nbsp;take a look how Document IDs work.&lt;/p&gt;
&lt;h2&gt;How does&amp;nbsp;a Document ID work&lt;/h2&gt;
&lt;p&gt;When a document is added to a document library and the Document ID feature is enabled in that site collection, the event &lt;strong&gt;ItemAdded &lt;/strong&gt;is trapped and the registered Document ID Provider is asked to&amp;nbsp;generate a Document ID. This&amp;nbsp;ID is then assigned to the DocumentID column. Note that the asynchronous event &lt;strong&gt;ItemAdded&lt;/strong&gt;&amp;nbsp;is used and not&lt;strong&gt; ItemAdding &lt;/strong&gt;to be able to access&amp;nbsp;metadata for the Item when assigning Document IDs. This page in the documentation explains more about the different events that&amp;nbsp;are used: &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ee559302(office.14).aspx"&gt;Document IDs and the DocID Service&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;you use a view that includes the DocumentID column or when you view the properties of the item, you will notice that the Document IDs are rendered as links to: &lt;strong&gt;_layouts/DocIdRedir.aspx&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document-Properties-_2D00_-Document-ID.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document-Properties-_2D00_-Document-ID.png" border="0" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is also a Document ID webpart to search for documents (The normal search also finds documents with Document IDs). That webpart also uses the &lt;strong&gt;DocIdRedir.aspx &lt;/strong&gt;page.&lt;/p&gt;
&lt;p&gt;If you want to add this webpart, it&amp;#39;s in the Documents Category and not in the Search Category:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Add-Document-ID-Webpart.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Add-Document-ID-Webpart.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How does DocIdRedir.aspx work?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The DocumentID column is an indexed property of Search. So when your document is indexed it can be found by using the Search API. But the Out-of-the-box DocumentIdProvider does something smarter first.&lt;/p&gt;
&lt;p&gt;Remember that the default structure of the DocumentId is: &amp;lt;Prefix&amp;gt;-&amp;lt;ListID&amp;gt;-&amp;lt;ListItemID&amp;gt;. So before asking SharePoint Search to find the document, it will first check the prefix if that is the prefix of the current Site Collection and if it is it can quite easy get the Item based on the ListID and ListItemID. If the item exists and&amp;nbsp;it has the same DocumentID then the users is redirected to this document. If the document can&amp;#39;t be found via this optimized way, then the Search API is used. If that also can&amp;#39;t find the document then an error is shown.&lt;/p&gt;
&lt;p&gt;Example of error message:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document-not-found.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document-not-found.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That is the behaviour of the Out-of-the-box DocumentIdProvider. Now we have enough information to look on how to custimize the provider.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Custom DocumentIdProvider&lt;/h2&gt;
&lt;p&gt;The generating of Document IDs can be custimized by creating a class that derives from &lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;Microsoft.Office.DocumentManagement.&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;DocumentIdProvider&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Arial;color:#000000;"&gt;The definition of DocumentIdProvider:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;namespace &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;Microsoft.Office.DocumentManagement&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&amp;nbsp;&amp;nbsp;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;abstract&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;class&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;DocumentIdProvider&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;protected&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; DocumentIdProvider();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;abstract&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;bool&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; DoCustomSearchBeforeDefaultSearch { &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;get&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;abstract&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; GenerateDocumentId(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPListItem &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;listItem);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;abstract&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;[] GetDocumentUrlsById(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; site, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;string &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;documentId);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;abstract&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; GetSampleDocumentIdText(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;site);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You have to implement the 3 abstract methods and 1 abstract property. But how are they meant to be used?&lt;/p&gt;
&lt;h3&gt;&lt;br /&gt;DoCustomSearchBeforeDefaultSearch &lt;/h3&gt;
&lt;p&gt;So what does this property do? Remember that the ootb provider first tries to find the document based on the ListId and ListItemId and if that doesn&amp;#39;t give a result it will revert to using SharePoint Search. This boolean controls that behaviour. Notice that there is also a &lt;em&gt;GetDocumentUrlsById&lt;/em&gt; method in this interface.&lt;/p&gt;
&lt;p&gt;If you return &lt;strong&gt;true,&lt;/strong&gt; then you let the &lt;em&gt;DocIdRedir.aspx&lt;/em&gt; know that you want it to call the &lt;em&gt;GetDocumentUrlsById&lt;/em&gt; first before calling Search. If you let this Property return false, you want to use SharePoint Search first, before using the &lt;em&gt;GetDocumentUrlsById&lt;/em&gt; method. Note that it will only tries the 2nd search method when the first search method doesn&amp;#39;t return a result!&lt;/p&gt;
&lt;h3&gt;&lt;br /&gt;GenerateDocumentId&lt;/h3&gt;
&lt;p&gt;This method is needed to generate the DocumentId. The SPListItem is passed as an argument in case you want to generate a Document ID based on the list item metadata. You have to return your DocumentId as a string.&lt;/p&gt;
&lt;h3&gt;&lt;br /&gt;GetDocumentUrlsById&lt;/h3&gt;
&lt;p&gt;This method is used to return the urls of the document based on a Document ID. This can be used as an alternative when the document isn&amp;#39;t indexed yet and therefor the Search way didn&amp;#39;t returned a result. Or if you have beter way to retrieve the document in the Site Collection.&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t want to return any urls, just return an empty string array.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#a52a2a;"&gt;&lt;span style="font-family:Consolas;color:#a52a2a;"&gt;&lt;span style="font-family:Consolas;color:#a52a2a;"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;&lt;em&gt;DoCustomSearchBeforeDefaultSearch&lt;/em&gt;&amp;nbsp;was &lt;strong&gt;true&lt;/strong&gt;, then returning the empty string array will signal the DocIdRedir.aspx to try it again&amp;nbsp;with the SharePoint Search. &lt;br /&gt;If &lt;em&gt;DoCustomSearchBeforeDefaultSearch&lt;/em&gt;&amp;nbsp;was &lt;strong&gt;false &lt;/strong&gt;then the SharePoint Search was called first but didn&amp;#39;t gave a result and the&amp;nbsp;GetDocumentUrlsById was called.&amp;nbsp;Returning an&amp;nbsp;empty string array in that case will generate a message that the file could not be found.&lt;/p&gt;
&lt;p&gt;An other possible scenario is that you set &lt;em&gt;DoCustomSearchBeforeDefaultSearch&lt;/em&gt;&amp;nbsp;to false and rely on the SharePoint Search. And if&amp;nbsp;that can&amp;#39;t find your document, you use the &lt;em&gt;GetDocumentUrlsById &lt;/em&gt;to return a fixed url to a page that informs the user that the document can&amp;#39;t be found (e.g. &lt;em&gt;The document might not be indexed at this time if it was recently added.&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;GetSampleDocumentIdText&lt;/h3&gt;
&lt;p&gt;This method is used to populate the Document ID webpart with an example.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document-ID-webpart.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Document-ID-webpart.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The text &lt;em&gt;E2E4NK52YQC4-1-1 &lt;/em&gt;is returned by this method in above example.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Registering the provider?&lt;/h2&gt;
&lt;p&gt;So now that you have&amp;nbsp;implemented your custom DocumentIdProvider, how do you get it registered&amp;nbsp;to a Site Collection (or unregistered)?&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t find any &lt;em&gt;STSADM &lt;/em&gt;or &lt;em&gt;PowerShell&lt;/em&gt; command for that, but the class &lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span&gt;Microsoft.Office.DocumentManagement.&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span&gt;DocumentId &lt;span style="font-family:Arial;color:#000000;"&gt;has 2 methods that we can use:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&amp;nbsp; public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;span style="color:#000000;"&gt;SetDefaultProvider&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;span style="color:#000000;"&gt;site);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&amp;nbsp; public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;span style="color:#000000;"&gt;SetProvider&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;span style="color:#000000;"&gt;site&lt;/span&gt;,&amp;nbsp;DocumentIdProvider&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;span style="color:#000000;"&gt;iProvider);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;The method &lt;em&gt;SetProvider&lt;/em&gt; will register your provider to SPSite and removing it is done by calling &lt;em&gt;SetDefaultProvider&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;A good way to call these methods is in the events of a Feature event receiver.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&amp;nbsp;&amp;nbsp;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;override&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; FeatureActivated(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPFeatureReceiverProperties&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;properties)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; site = (&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;)properties.Feature.Parent;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;DocumentId&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;.SetProvider(site,&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;new GuidDocumentIdProvider&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;()));&lt;br /&gt;&amp;nbsp; }&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;override&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;&lt;span style="font-family:Consolas;color:#0000ff;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; FeatureDeactivating(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPFeatureReceiverProperties&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; properties)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt; site = (&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;SPSite&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;)properties.Feature.Parent;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;&lt;span style="font-family:Consolas;color:#2b91af;"&gt;DocumentId&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;.SetDefaultProvider(site);&lt;br /&gt;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;&lt;span style="font-family:Consolas;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Once the custom provider is registered, you will not be allowed to change the prefix in the &lt;em&gt;Document ID Settings&lt;/em&gt; page in &lt;em&gt;Site Settings.&lt;/em&gt;Which is logical, since you are no longer using the OOTB DocumentIdProvider.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Example source code&lt;/h2&gt;
&lt;p&gt;I also uploaded an example implementation to the &lt;a target="_blank" href="http://blog.michelbarneveld.nl/media/8/default.aspx"&gt;Files section&lt;/a&gt;. It includes a SharePoint 2010 project for Visual Studio 2010 (beta2). That project contains the Custom DocumentIdProvider called GuidDocumentIdProvider that&amp;nbsp;uses GUIDs as Document IDs&amp;nbsp;and a feature GuidDocumentIdFeature to enable and disable the GuidDocumentIdProvider.&lt;/p&gt;
&lt;p&gt;Code can be found here: &lt;a target="_blank" href="http://blog.michelbarneveld.nl/media/p/35.aspx"&gt;Custom DocumentIdProvider Example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When experimenting with this example, make sure you crawl your SharePoint site after adding documents, otherwise the documents can not be found by the DocIdRedir.aspx page.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=34" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/2010/default.aspx">2010</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Development/default.aspx">Development</category></item><item><title>Kernel-mode authentication performance benefits</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/12/02/kernel-mode-authentication-performance-benefits.aspx</link><pubDate>Wed, 02 Dec 2009 20:30:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:30</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=30</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=30</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/12/02/kernel-mode-authentication-performance-benefits.aspx#comments</comments><description>&lt;p&gt;2 Weeks ago I wrote&lt;a target="_blank" href="http://blog.michelbarneveld.nl/michel/archive/2009/11/16/sharepoint-2010-and-kernel-mode-authentication.aspx"&gt; a post about kernel-mode authentication and SharePoint 2010&lt;/a&gt;. One of my questions was: What is the performance benefit of using kernel-mode authentication?&lt;/p&gt;
&lt;p&gt;I did some testing last week and now I had time to analyze the results and create some graphs out of those results.&lt;/p&gt;
&lt;h2&gt;&lt;br /&gt;The test setup&amp;nbsp;&lt;/h2&gt;
&lt;p&gt;I defined some requirements for my tests:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Test the authentication with a minimum of overhead&lt;/li&gt;
&lt;li&gt;Test without IIS or client caching&lt;/li&gt;
&lt;li&gt;Automated and repeatable&amp;nbsp;tests&lt;/li&gt;
&lt;li&gt;Test with multiple users&lt;/li&gt;
&lt;li&gt;Test with multiple threads&lt;/li&gt;
&lt;li&gt;Test with different amounts of group memberships&lt;/li&gt;
&lt;li&gt;Test with separate client and web server&lt;/li&gt;
&lt;li&gt;Test with full stressed web server and not full stressed client&lt;/li&gt;
&lt;li&gt;Test with different application pool identities&lt;/li&gt;
&lt;li&gt;Test Kerberos and NTLM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;Based on those requirements I used the following setup:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Users &amp;amp; Groups&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Created&amp;nbsp;750 AD users (TestUser0001 to TestUser0750)&lt;/li&gt;
&lt;li&gt;Created 100 AD groups (TestGroup0001 to TestGroup0100)&lt;/li&gt;
&lt;li&gt;TestUser0001-0250 are member of 100 groups&lt;/li&gt;
&lt;li&gt;TestUser0251-0500 are member of 50 groups&lt;/li&gt;
&lt;li&gt;TestUser0501-0750 are member of 0 groups&lt;/li&gt;
&lt;li&gt;Created account for application pool identity (using Kerberos AES 256 bit encryption).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So I have 3 sets of users with different group memberships (0, 50 and 100 groups)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Web server&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hyper-V VM&lt;/li&gt;
&lt;li&gt;Single CPU with limit of 20% CPU usage on host*&lt;/li&gt;
&lt;li&gt;windows 2008R2&lt;/li&gt;
&lt;li&gt;4 sites with 4 application pools&lt;/li&gt;
&lt;li&gt;each application pool with a different authentication setting 
&lt;ul&gt;
&lt;li&gt;Negotiate:Kerberos (Kerberos only provider and can only work with&amp;nbsp;kernel-mode off)&lt;/li&gt;
&lt;li&gt;Negotiate with kernel-mode off&lt;/li&gt;
&lt;li&gt;Negotiate with kernel-mode on (SPN registered on machine account)&lt;/li&gt;
&lt;li&gt;Negotiate with kernel-mode on (SPN registered on app pool identity + useApplicationPoolCredentials setting)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;1 single HTML file in the root**&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*) The web server was way more efficient in decrypting Kerberos tickets than the client was in encrypting them. I needed to lower the CPU speed of the web server to make sure it was at 100% CPU usage while the client was not completely stressed out. Setting it to 20% in Hyper-V slowed down the web server enough to get it at 100% CPU usage, while keeping the CPU usage of the client far enough from 100%.&lt;/p&gt;
&lt;p&gt;**) To isolate the performance of authentication I wanted to eliminate the overhead of the .Net framework so I didn&amp;#39;t use any aspx files but a plain .HTML file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;br /&gt;Client:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 2008R2 in the same domain (I know that the 10&amp;nbsp;connection limit were removed in Vista SP2 and Windows 7, but just to be sure I used a server OS as client)&lt;/li&gt;
&lt;li&gt;Physical machine with dual core CPU&lt;/li&gt;
&lt;li&gt;Custom written .Net test application 
&lt;ul&gt;
&lt;li&gt;Used a queue of 5000 requests&lt;/li&gt;
&lt;li&gt;Used 32 threads to fire those 5000 requests (I tested with 1,2,4 and 8 threads first, but that couldn&amp;#39;t get the server at 100%)&lt;/li&gt;
&lt;li&gt;Used the credentials of 30 different users (I wanted to use the whole set of 250 users, but using more than 40 users made the client app using 100% CPU, so with 30 users I was on the safe side)&lt;/li&gt;
&lt;li&gt;Each thread would ask the queue for the next request and based on the request number (using modulo)&amp;nbsp;it used a different user for the request: User = RequestNumber % 30 (examples: RequestNumber 21-&amp;gt;User21, RequestNumber 33 -&amp;gt; User3, etc)&lt;/li&gt;
&lt;li&gt;Request are of form: http://site1.mb.local/test.html?&amp;lt;GUID&amp;gt;&amp;nbsp;&amp;nbsp;(The GUID makes the request unique so prevent client or server side caching)&lt;/li&gt;
&lt;li&gt;The time was captured to complete those 5000 requests&lt;/li&gt;
&lt;li&gt;Each test was run 6 times. The first run was discarded. In the presented results the average of the 5 runs was used and converted to requests per second.&lt;/li&gt;
&lt;li&gt;The user set was configurable, so the tests could be batched with different group memberships.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Test 1 - Kerberos authentication using the ApplicationPoolIdentity&lt;/h2&gt;
&lt;p&gt;For the first test I configured the 4 application pools to use the built-in ApplicationPoolIdentity as the identity of the application pool. And I registered the SPN&amp;#39;s of the 4 URLs to the machine account.&lt;/p&gt;
&lt;p&gt;Result:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-kerberos-apppoolidentity.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-kerberos-apppoolidentity.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2 Observations from above graph:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Using kernel-mode authentication (green and purple bars) has a significant improvement over the disabled kernel-mode bars (blue and red)&lt;/li&gt;
&lt;li&gt;When the users are member of more groups the overall performance decreases. That is expected because the Kerberos ticket size will increase since each group membership is included in a Kerberos ticket and with more tickets there is more data to decrypt.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note:&lt;br /&gt;This scenario is not compatible&amp;nbsp;with web farm scenario&amp;#39;s. When you have multiple web servers you must use domain accounts for the application pool identity and register the SPN&amp;#39;s to that account.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Test&amp;nbsp;2 - Kerberos authentication using a domain account&lt;/h2&gt;
&lt;p&gt;For the second test I configured the 4 application pools to use a custom domain account as the identity of the application pool. And I registered the SPN&amp;#39;s of&amp;nbsp;3 URLs to that&amp;nbsp;domain account. The 4th SPN was registered to the machine account, because the Kerberos tickets are decrypted by the machine account when using kernel-mode authentication without the &lt;em&gt;useAppPoolCredentials&lt;/em&gt; setting.&lt;/p&gt;
&lt;p&gt;The domain account used as the application pool identity didn&amp;#39;t have any delegations configured to other services.&lt;/p&gt;
&lt;p&gt;Result:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-kerberos-domain-no-delegate.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-kerberos-domain-no-delegate.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;*)&amp;nbsp;Kernel-mode on (the green&amp;nbsp;bar)&amp;nbsp;is not compatible&amp;nbsp;with web farm scenario&amp;#39;s, because the SPN is registered to the machine account.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;3 Observations from above graph:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Also with this test there is more performance when using kernel-mode.&lt;/li&gt;
&lt;li&gt;And also the performance decreases with more group memberships.&lt;/li&gt;
&lt;li&gt;The performance of the kernel-mode enabled scenario&amp;#39;s is the same as in the first test. However the performance of the kernel-mode disabled scenario&amp;#39;s is &lt;strong&gt;significant less&lt;/strong&gt; compared to test 1!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I also captured the request lenght and noticed something odd: The request length of the green bar scenario was much larger (almost doubled) compared to the other 3. The only difference was that this scenario has the SPN registered to the machine account instead of the domain account. After inspection of the Kerberos tickets I discovered the difference: The ticket for the machine account was almost twice as large compared to the ticket for the domain account&amp;nbsp;and there was also an other difference: it has the&amp;nbsp;&lt;strong&gt;&lt;em&gt;ok_as_delegate&lt;/em&gt;&lt;/strong&gt; flag. That flag means that the user credentials can be delegated to any other service (&lt;strong&gt;TRUSTED_FOR_DELEGATION&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;So tickets&amp;nbsp;for&amp;nbsp;SPN&amp;#39;s registered to&amp;nbsp;the machine account has the&amp;nbsp;&lt;strong&gt;ok_as_delegate&lt;/strong&gt;&amp;nbsp;flag set.&amp;nbsp;I didn&amp;#39;t confirm if&amp;nbsp;it actually&amp;nbsp;allows to delegate to any service (the normal TRUSTED_FOR_DELEGATION setting).&amp;nbsp;But I did test what happens when I gave my domain account the same&amp;nbsp;&amp;quot;delegate to any service&amp;quot; setting. The&amp;nbsp;Kerberos tickets for the domain account became twice as large, just like for the machine account!&lt;/p&gt;
&lt;p&gt;So when a service account has the &amp;quot;Delegate to any service&amp;quot; setting set, the Kerberos tickets for SPN&amp;#39;s registered to that account will get twice as large. That&amp;#39;s an interesting finding! &lt;br /&gt;To put this in perspective: The Kerberos tickets at my current customer are around the 7KB in size (yep large organization with a lot of groups),&amp;nbsp;&amp;nbsp;So 90% of the web request size is this Kerberos tickets. And if you trust this domain account to delegate to any service it is even doubling the request size. That has impact on performance when dealing with large volumes of clients. But since we are only using constrained delegation and don&amp;#39;t have any accounts with the delegate to any service option, we don&amp;#39;t have these larger tickets.&lt;/p&gt;
&lt;p&gt;To see if that delegate to any service has an impact on the performance of the authentication I used a 3rd test:&lt;/p&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;Test&amp;nbsp;3 - Kerberos authentication using a domain account with delegate to any service&lt;/h2&gt;
&lt;p&gt;For the third test I used the same configuration as the second test with the exception that the domain account was trusted for delegation to any service. &lt;/p&gt;
&lt;p&gt;Result:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-kerberos-domain-delegate-any.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-kerberos-domain-delegate-any.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;*)&amp;nbsp;Kernel-mode on (the green&amp;nbsp;bar)&amp;nbsp;is not compatible&amp;nbsp;with web farm scenario&amp;#39;s, because the SPN is registered to the machine account.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;3 Observations from above graph:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Same results as previous tests (kernel-mode is faster and being a member of more groups is slower)&lt;/li&gt;
&lt;li&gt;The performance of the green bar scenario is the same as in Test 2. Remember that this scenario has the SPN registered to the machine account. The ticket size remains the same as in Test 2, so this is expected behavior.&lt;/li&gt;
&lt;li&gt;The performance of the 3 other scenario&amp;#39;s is decreased! So the change to the domain account&amp;nbsp;being trusted for delegation has increased the ticket size and effected the performance, which is expected when you have to decrypt a larger ticket.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Test&amp;nbsp;4 -&amp;nbsp;NTLM authentication using the ApplicationPoolIdentity&lt;/h2&gt;
&lt;p&gt;Kerberos was tested in the first 3 tests. But will NTLM authentication have the same result? That&amp;#39;s what test 4 and 5 is about.&lt;/p&gt;
&lt;p&gt;For test 4, I used 2 sites with 2 application pools and used the NTLM authentication provider. One site is using kernel-mode enabled the other one is disabled. Both application pool use the built-in ApplicationPoolIdentity as application pool identity for this test.&lt;/p&gt;
&lt;p&gt;Result:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-ntlm-apppoolidentity.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-ntlm-apppoolidentity.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2&amp;nbsp;Observations from above graph:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kernel-mode authentication has also improved performance for NTLM.&lt;/li&gt;
&lt;li&gt;The group membership doesn&amp;#39;t effect NTLM authentication performance. Which is expected because the groups&amp;nbsp;are not included in the NTLM authorization header as is the case with Kerberos.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Test&amp;nbsp;5 -&amp;nbsp;NTLM authentication using a domain account&lt;/h2&gt;
&lt;p&gt;So is there a difference using a domain account as the application pool identity as we saw in the Kerberos tests? This test will give the answer.&lt;/p&gt;
&lt;p&gt;The application pools from test 4 were now configured to use a domain account.&lt;/p&gt;
&lt;p&gt;Result:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-ntlm-domain.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Performance-kernel_2D00_mode-ntlm-domain.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;1 Observations from above graph:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using a domain account as the application pool identity doesn&amp;#39;t effect the authentication performance. It&amp;#39;s the same result as with test 4.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Conclusions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Using Kernel-mode authentication can give&amp;nbsp;up to&amp;nbsp;a 20% to 25% performance boost. &lt;br /&gt;Note: In real-world scenario&amp;#39;s this will most likely be much lower, because above test scenario&amp;#39;s were optimized to show the impact of kernel-mode authentication.&lt;/li&gt;
&lt;li&gt;Using an application pool identity account that is trusted for delegation will lower the performance boost. Use constrained delegation for maximum performance ( and is more secure btw)&lt;/li&gt;
&lt;li&gt;The more groups users are member of the lower the performance of Kerberos authentication.&lt;/li&gt;
&lt;li&gt;Using the Kerberos only authentication provider is a good way to enforce the use of Kerberos authentication, but it can&amp;#39;t profit of the performance boost since it&amp;#39;s not compatible with kernel-mode authentication.&lt;/li&gt;
&lt;li&gt;When you can&amp;#39;t use kernel-mode authentication&amp;nbsp;(like in the Kerberos only scenario), you will get the most performance with Kerberos&amp;nbsp;using the built-in ApplicationPoolIdentity as the application pool identity instead of a domain account. However this is only possible for single web server scenario&amp;#39;s. Web farm Kerberos scenario&amp;#39;s require domain accounts as application pool identities.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=30" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/IIS/default.aspx">IIS</category></item><item><title>How to enable Intel VT on Acer Aspire 7720G laptop</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/11/27/how-to-enable-intel-vt-on-acer-aspire-7720g-laptop.aspx</link><pubDate>Thu, 26 Nov 2009 22:10:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:27</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=27</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=27</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/11/27/how-to-enable-intel-vt-on-acer-aspire-7720g-laptop.aspx#comments</comments><description>&lt;p&gt;My laptop, an Acer Aspire 7720G, has an Intel T7500 Core 2 Duo Mobile CPU. This CPU has support for hardware-assisted Intel&amp;reg; Virtualization Technology (VT). That&amp;#39;s the reason why I bought this laptop some years ago. It was a big disappointment when I discovered that Acer turned that option off in the BIOS and didn&amp;#39;t offer a way to turn it on. So I couldn&amp;#39;t use this laptop to test Hyper-V on Windows 2008 (R2) or XP mode on Windows 7, which both require hardware virtualization. But now there is a solution!!! &lt;img src="http://blog.michelbarneveld.nl/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;
&lt;p&gt;I have been searching the Internet for a solution for quite some time now. But today I discovered the solution on this blog: &lt;a target="_blank" href="http://marcansoft.com/blog/2009/06/enabling-intel-vt-on-the-aspire-8930g/"&gt;Enabling Intel VT on the Aspire 8930G (and other InsydeH2O-based laptops)&lt;/a&gt;&lt;br /&gt;Bigted gave the steps I needed. &lt;a target="_blank" href="http://marcansoft.com/blog/2009/06/enabling-intel-vt-on-the-aspire-8930g/#comment-203"&gt;His steps&lt;/a&gt; were for the 5720G, but they also worked for my 7720G.&lt;/p&gt;
&lt;p&gt;The steps (credits go to bigted for the original steps&amp;nbsp;and marrio for updated instructions in the comments):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download the latest BIOS from Acer and flash it to make sure the laptop is running the latest version of the BIOS before proceeding. (&lt;a target="_blank" href="http://global-download.acer.com/GDFiles/BIOS/BIOS/BIOS_v1.45.zip?acerid=633643256187451575&amp;amp;Step1=Notebook&amp;amp;Step2=Aspire&amp;amp;Step3=Aspire%207720G&amp;amp;OS=V10&amp;amp;LC=nl&amp;amp;BC=Acer&amp;amp;SC=EMEA_18"&gt;link to 7720G bios&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Extract BIOS_v1.45.exe from that zip file.&lt;/li&gt;
&lt;li&gt;Now extract the files in BIOS_v1.45.exe using winrar, 7-zip, etc. to a new directory. (right click the file -&amp;gt; extract to...&amp;nbsp; or something like that)&lt;/li&gt;
&lt;li&gt;Edit&amp;nbsp;the extracted file platform.ini and change &lt;strong&gt;BackupName= &lt;/strong&gt;to &lt;strong&gt;BackupName=acer7720Gdump.fd&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Run InsydeFlash.exe&amp;nbsp;as Administrator&amp;nbsp;but &lt;strong&gt;CANCEL the flash&lt;/strong&gt;. We only need it to create a backup of the BIOS in the file &lt;strong&gt;acer7720Gdump.fd.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Download the latest version of the &lt;a target="_blank" href="http://www.python.org/download/"&gt;&lt;strong&gt;2.6.x&lt;/strong&gt; &lt;strong&gt;version&lt;/strong&gt;&lt;/a&gt; of python and install it&lt;strong&gt;.&amp;nbsp;The next steps&amp;nbsp;will not work with a 3.x version of python!!!&amp;nbsp;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Copy MaxL&amp;rsquo;s vtenable.py (&lt;a rel="nofollow" href="http://pastebin.com/f604e244a"&gt;&lt;span style="color:#0066cc;"&gt;http://pastebin.com/f604e244a&lt;/span&gt;&lt;/a&gt;) (&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/vtenable.py"&gt;archived version&lt;/a&gt;)into same folder as dump file. &lt;/li&gt;
&lt;li&gt;Run &amp;ldquo;vtenable.py acer7720Gdump.fd acer7720GdumpVT.fd&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Check with a binary comparison tool (like &lt;a target="_blank" href="http://www.cjmweb.net/vbindiff/"&gt;vbindiff&lt;/a&gt;)&amp;nbsp;that only 1 byte changed value, in my case from 00 to 01,&amp;nbsp;between the files &lt;strong&gt;acer7720Gdump.fd&lt;/strong&gt; and &lt;strong&gt;acer7720GdumpVT.fd&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Open the platform.ini again and ...&lt;/li&gt;
&lt;li&gt;Change &lt;strong&gt;BackupName=acer7720Gdump.fd &lt;/strong&gt;back to &lt;strong&gt;BackupName= &lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;And in the section &lt;strong&gt;[Option]&lt;/strong&gt; change &lt;strong&gt;Flag=0 &lt;/strong&gt;to &lt;strong&gt;Flag=1&lt;/strong&gt;&amp;nbsp; (Flag 1-&amp;gt; User option mode, including option, start, exit buttons.)&lt;/li&gt;
&lt;li&gt;Save the platform.ini&lt;/li&gt;
&lt;li&gt;Run InsydeFlash.exe as Administrator.&lt;/li&gt;
&lt;li&gt;Click on the button &lt;strong&gt;Option&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Option&lt;/strong&gt; tab select the new &lt;strong&gt;acer7720GdumpVT.fd &lt;/strong&gt;as the filename&lt;/li&gt;
&lt;li&gt;Go to the tab &lt;strong&gt;ROM Protection List &lt;/strong&gt;and select &lt;strong&gt;Flash all&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;OK&lt;/strong&gt; to close the option screen.&lt;/li&gt;
&lt;li&gt;Click on Start&lt;/li&gt;
&lt;li&gt;After it&amp;#39;s finished it will restart the computer.&lt;/li&gt;
&lt;li&gt;Congrats! VT is now enabled!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;[edit: 02-Aug-2010]&lt;br /&gt;Update to&amp;nbsp;instructions with improvements from Marrio.&lt;br /&gt;Verified the procedure with the laptop of a friend. It&amp;#39;s working!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=27" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Virtualization/default.aspx">Virtualization</category></item><item><title>SharePoint 2010 and Kernel-mode Authentication</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/11/16/sharepoint-2010-and-kernel-mode-authentication.aspx</link><pubDate>Mon, 16 Nov 2009 13:16:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:22</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=22</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=22</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/11/16/sharepoint-2010-and-kernel-mode-authentication.aspx#comments</comments><description>&lt;p&gt;I was wondering what authentication settings SharePoint 2010 will use when creating a new Web Application. Because Windows Server 2008 introduced Kernel-mode Authentication and Windows Server 2008 R2 introduced a Kerberos-only authentication provider.&lt;/p&gt;
&lt;p&gt;So first a few lines on the what and the where of these settings and after that what SharePoint 2010 uses as default.&lt;/p&gt;
&lt;h2&gt;Kernel-mode Authentication&lt;/h2&gt;
&lt;p&gt;This is a new setting in IIS7 (Windows 2008 and Vista SP1) that when enabled increases authentication performance by requiring less switching between user-mode and kernel-mode code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can find this setting in Authentication section in IIS.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS7-_2D00_-Authentication.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS7-_2D00_-Authentication_5F00_small.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS7-_2D00_-Authentication_5F00_small.png" border="0" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then right click &amp;quot;&lt;em&gt;Windows Authentication&lt;/em&gt;&amp;quot; and click &amp;quot;&lt;em&gt;Advanced Settings...&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-Authentication-_2D00_-Advanced-Settings.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-Authentication-_2D00_-Advanced-Settings.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And there you have the toggle box to switch Kernel-mode Authentication on or off.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-_2D00_-Kernel_2D00_mode-authentication.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-_2D00_-Kernel_2D00_mode-authentication.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And according to the description we want to have it enabled: &amp;quot;...&lt;em&gt;improve authentication performance and prevent authentication problems...&lt;/em&gt;&amp;quot; ;-)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;br /&gt;Kerberos-only authentication provider (Negotiate:Kerberos provider)&lt;/h2&gt;
&lt;p&gt;Before this setting was introduced&amp;nbsp;if you wanted to use Kerberos, you would use the Negotiate authentication provider instead of NTLM. However the Negotiate provider will fall back to NTLM authentication if Kerberos authentication fails. So there was no way to enforce Kerberos. With this&amp;nbsp;new provider&amp;nbsp;you can enforce Kerberos.It will&amp;nbsp;&lt;strong&gt;not&lt;/strong&gt; fall back to NTLM.&lt;/p&gt;
&lt;p&gt;You can find that setting in the same Authentication section as above. However you choose &amp;quot;&lt;em&gt;Providers...&lt;/em&gt;&amp;quot; instead of &amp;quot;&lt;em&gt;Advanced Settings...&lt;/em&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-Authentication-_2D00_-Providers.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-Authentication-_2D00_-Providers.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And that will give you option to select which Authentication Provider to use:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-Authentication-_2D00_-All-providers.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/IIS-Authentication-_2D00_-All-providers.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So there are 3 options: NTLM, Negotiate and Negotiate:Kerberos.&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;you select&amp;nbsp;&lt;em&gt;Negotiate:Kerberos&lt;/em&gt;&amp;nbsp;and have Kernel-mode authentication turned on, you will get the following warning however:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Negotiate-Kerberos-Error.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Negotiate-Kerberos-Error.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So this new provider is not compatible with Kernel-mode authentication. NTLM and Negotiate are compatible and will not&amp;nbsp;give this warning.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Negotiate provider and Kernel-mode authentication&lt;/h2&gt;
&lt;p&gt;Note that the setting of Kernel-mode Authentication will change the behaviour of the Negotiate provider.&lt;/p&gt;
&lt;p&gt;If Kernel-mode authentication is enabled, then&amp;nbsp;the Kerberos tickets will be decrypted with the local system account. That means that your SPN must be register to the machine account!!!&lt;br /&gt;If Kernel-mode authentication is disabled, it will show the normal behaviour of decrypting Kerberos tickets with the application pool identity. The SPN&amp;nbsp;must&amp;nbsp;be&amp;nbsp;registered to the used application pool identity then.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;So you change the account you register the SPN on when using Kernel-mode, so what&amp;#39;s the deal?&amp;quot;&lt;/em&gt;&lt;br /&gt;Well, if you are using a (loadbalanced) multi web frontend SharePoint farm (which is&amp;nbsp;like 95% of&amp;nbsp;the SharePoint farm configurations I do), you must run the application pool on each web server&amp;nbsp;with the same domain account if you want to use Kerberos. The SPN for the loadbalanced url can only be registered to 1 single account and not to 2 or more machine accounts, otherwise Kerberos authentication will fail.&lt;br /&gt;So this would mean that you can&amp;#39;t use Kernel-mode authentication when doing Kerberos on a webfarm.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;There is a way however to use Kernel-mode authentication and Kerberos authenticated webfarms&lt;/strong&gt;. &lt;br /&gt;There is a setting which is &lt;strong&gt;NOT in the GUI interface of IIS&lt;/strong&gt; to enable the use of the Application Pool Identity to decrypt the Kerberos tickets. It&amp;#39;s explained in the &lt;a target="_blank" href="http://technet.microsoft.com/en-us/library/dd573004(office.13).aspx"&gt;OCS 2007 R2 documentation&lt;/a&gt;, which basically tells us to set the &lt;strong&gt;&lt;em&gt;useAppPoolCredentials &lt;/em&gt;&lt;/strong&gt;attribute to &lt;strong&gt;&lt;em&gt;true&lt;/em&gt;&lt;/strong&gt; of the &lt;strong&gt;&lt;em&gt;WindowsAuthentication&lt;/em&gt;&lt;/strong&gt; element&amp;nbsp;in the file &lt;strong&gt;&lt;em&gt;%windir%\system32\inetsrv\config\ApplicationHost.config.&lt;/em&gt;&lt;/strong&gt; This look like some undocumented feature because it&amp;#39;s not in the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/aa347472.aspx"&gt;documentation&lt;/a&gt; &lt;img src="http://blog.michelbarneveld.nl/emoticons/emotion-5.gif" alt="Wink" /&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Example of configuration:&lt;br /&gt;&amp;lt;system.webServer&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;authentication&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;windowsAuthentication enabled=&amp;quot;true&amp;quot;&lt;strong&gt; useAppPoolCredentials=&amp;quot;true&amp;quot;&lt;/strong&gt; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/authentication&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/security&amp;gt;&lt;br /&gt;&amp;lt;/system.webServer&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;What are the SharePoint 2010 defaults?&lt;/h2&gt;
&lt;p&gt;When you create a new webapplication you have the choice of using Negotiate (Kerberos) or NTLM as the authentication provider.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/SharePoint-_2D00_-Security-Configuration.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/SharePoint-_2D00_-Security-Configuration.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Negotiate (Kerberos)&lt;br /&gt;&lt;/strong&gt;Before I tested this I was wondering if on a Windows Server 2008 R2 environment the &lt;strong&gt;Negotiate:Kerberos&lt;/strong&gt; (Kerberos only) or the normal &lt;strong&gt;Negotiate&lt;/strong&gt; provider was used.&lt;br /&gt;I created a new web application and&amp;nbsp;it enabled the &lt;strong&gt;normal&lt;/strong&gt; &lt;strong&gt;Negotiate&lt;/strong&gt; and &lt;strong&gt;NTLM authentication&amp;nbsp;&amp;nbsp;provider&lt;/strong&gt;&amp;nbsp;and &lt;strong&gt;Kernel-mode authentication was turned off.&lt;br /&gt;&lt;/strong&gt;That the Kernel-mode was turned off makes some sense: a lot of SharePoint farms will use multiple web frontends and setting a hidden and&amp;nbsp;lesser documented setting in IIS to make it work might create extra support calls &lt;img src="http://blog.michelbarneveld.nl/emoticons/emotion-5.gif" alt="Wink" /&gt; But if Kernel-mode was turned off anyway, they could have used the Kerberos only provider. But maybe there&amp;nbsp;is some kind of compatibilty issue?&lt;/p&gt;
&lt;p&gt;I have tested SharePoint 2010 in a webfarm with the following 2 scenario&amp;#39;s:&lt;br /&gt;1)&amp;nbsp;Negotiate:Kerberos (Kerberos only) and Kernel-mode authentication turned&amp;nbsp;off&lt;br /&gt;2) Negotiate (Normal Negotiate) and Kernel-mode authentication plus the useAppPoolCredentials setting in the ApplicationHost.config file&lt;/p&gt;
&lt;p&gt;And they both worked without problems with SharePoint 2010.&amp;nbsp;So I am not sure if there was some design reason behind this.&amp;nbsp;I&amp;#39;ll ask&amp;nbsp;some friends at Microsoft about this soon.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NTLM&lt;br /&gt;&lt;/strong&gt;So now NTLM. When you choose it, it will &lt;strong&gt;only enable the NTLM&lt;/strong&gt; provider and &lt;strong&gt;turns off Kernel-mode authentication&lt;/strong&gt;. Normally&amp;nbsp;Kernel-mode&amp;nbsp;is on by default. But SharePoint turns it off. I have no idea why. I tested it when turned on and it worked with SharePoint 2010.&amp;nbsp;So the SharePoint team probably decided somewhere to turn it off.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;SharePoint 2010 (beta 2)&amp;nbsp;does not use the new authentication features offered by Windows Server 2008 and R2. It will turn off the use of Kernel-mode authentication. Hopefully I have some answers soon if this was a design choice. In my testing scenario&amp;#39;s SharePoint 2010 can work in Kernel-mode.&amp;nbsp;I haven&amp;#39;t discovered any issues yet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So I am stuck now with a very important question:&amp;nbsp;&lt;strong&gt;How much performance improvement are we missing if SharePoint 2010 is not using Kernel-mode authentication?&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;I already did some testing. Have to write a blog post about it, because the results surprised me! So stay tuned!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=22" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/2010/default.aspx">2010</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Security/default.aspx">Security</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/IIS/default.aspx">IIS</category></item><item><title>The reason why KB911149 and KB908209 are not the solution!</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/11/14/the-reason-why-kb911149-and-kb908209-are-not-the-soluton.aspx</link><pubDate>Sat, 14 Nov 2009 21:26:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:21</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=21</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=21</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/11/14/the-reason-why-kb911149-and-kb908209-are-not-the-soluton.aspx#comments</comments><description>&lt;p&gt;&lt;em&gt;&amp;quot;Do not use CNAME dns records and non default web ports when using Kerberos!&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The last 2 years I have done quite some Kerberos review and troubleshooting sessions (usually in combination with SharePoint) for big customers&amp;nbsp;of Imtech but also&amp;nbsp;for some&amp;nbsp;Microsoft customers. And quite often I tell them the above sentence to not use CNAME dns records and non default web ports when doing Kerberos authentication. So, does that mean that Kerberos doesn&amp;#39;t work with CNAME dns records and non default web ports? No, Kerberos can work with that ... in some cases. But usually it complexes the setup and introduces different behaviour for different versions of Windows, Internet Explorer and other client.&lt;br /&gt;And that is the key take away of this blog entry:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you&amp;nbsp;use HOST A&amp;nbsp;dns records and&amp;nbsp;default web ports (80 and 443) than all version of the Windows&amp;nbsp;OS, Internet Explorer and other Web Clients will&amp;nbsp;show the same consistent behaviour. When you introduce CNAME records or non default ports than&amp;nbsp;different applications or versions&amp;nbsp;will show different behaviour.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;A lot of my customers are unaware of the different behaviour, but some are and give a response like:&lt;br /&gt;&lt;strong&gt;Customer&lt;/strong&gt;: &amp;quot;&lt;em&gt;Yeah, we know that. But we have implemented KB911149, KB938305 and/or KB908209 (and maybe even some others) on all our desktops. So we shouldn&amp;#39;t have a problem.&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;h2&gt;&lt;br /&gt;So what are these KB articles?&lt;/h2&gt;
&lt;h3&gt;KB911149 and KB938305&lt;/h3&gt;
&lt;p&gt;&lt;a target="_blank" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;911149"&gt;KB911149&lt;/a&gt; and &lt;a target="_blank" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;938305"&gt;KB938305&lt;/a&gt;&amp;nbsp;are fixes for Internet Explorer to use CNAME records with Kerberos authentication. On some versions you need to apply a hotfix, but you always need to enable the feature by setting a registry key.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;So what is the problem with CNAME dns records and Kerberos?&lt;br /&gt;&lt;/strong&gt;A CNAME dns record is an &lt;em&gt;alias&lt;/em&gt; to another dns record. So it doesn&amp;#39;t point to an IP address but to another record.&amp;nbsp;&lt;br /&gt;Let&amp;#39;s say &lt;em&gt;vanity.domain.com&lt;/em&gt;&amp;nbsp;is a CNAME for &lt;em&gt;server123.domain.com&lt;/em&gt; which is a HOST A record for &lt;em&gt;1.2.3.4.&lt;br /&gt;&lt;/em&gt;Something like: &lt;em&gt;vanity.domain.com -&amp;gt; server123.domain.com -&amp;gt; 1.2.3.4&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When you go to the url &lt;em&gt;&lt;strong&gt;http://vanity.domain.com&lt;/strong&gt;&lt;/em&gt; you would expect you will request a Kerberos ticket for &lt;em&gt;&lt;strong&gt;http/vanity.domain.com&lt;/strong&gt;&lt;/em&gt;, but because it&amp;#39;s a CNAME&amp;nbsp;most applications (like IE)&amp;nbsp;will try to&amp;nbsp;get a ticket for &lt;strong&gt;&lt;em&gt;http/server123.domain.com.&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;So if you didn&amp;#39;t have the spn &lt;em&gt;http/server123.domain.com&lt;/em&gt; registered to the application pool identity it will fail the authentication. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Register the spn to the machinename&amp;nbsp;and finished right?&lt;/strong&gt; &lt;br /&gt;Well most of the time it&amp;#39;s not that simple. If you have multiple websites with each have it&amp;#39;s own CNAME dns name pointing to the same&amp;nbsp;hostname&amp;nbsp;and they are using different application pool identities than this will not work. A SPN must be registered to&amp;nbsp;&lt;strong&gt;one and only&amp;nbsp;one&lt;/strong&gt;&amp;nbsp;account.&amp;nbsp;If you have the&amp;nbsp;SPN registered to&amp;nbsp;Account &lt;strong&gt;A&lt;/strong&gt; and request a&amp;nbsp;ticket for that&amp;nbsp;SPN, it will be encrypted by the&amp;nbsp;password hash of Account &lt;strong&gt;A&lt;/strong&gt;. So when your application pool identity is Account &lt;strong&gt;B &lt;/strong&gt;it will receive the ticket from the client, but it can&amp;#39;t decrypt it, because it is encrypted with the password hash of Account &lt;strong&gt;A&lt;/strong&gt; and not of Account &lt;strong&gt;B&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The KB articles mentioned above will change this behaviour for Internet Explorer. So when you have a CNAME it will request a SPN for that CNAME.&lt;br /&gt;This is a client fix, you need to deploy this to all your clients within the organisation. And note that it will &lt;strong&gt;only fix Internet Explorer&lt;/strong&gt;! Other webclients might not pick this up&lt;br /&gt;Also does this fix&amp;nbsp;not work anymore on Windows 7 with IE8. So&amp;nbsp;IE8 shows the original behaviour. (Microsoft might have changed the way to turn this on. To be honest I haven&amp;#39;t looked for a new way. But I did confirm that the way mentioned in the KB articles doesn&amp;#39;t work anymore.)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;/h3&gt;
&lt;h3&gt;KB908209&lt;/h3&gt;
&lt;p&gt;This &lt;a target="_blank" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;908209"&gt;KB908209&lt;/a&gt; article is about fixing Wininet to include the port number when requesting a Kerberos ticket. This is also a client fix and you need to specify in the registry which application should get the new behaviour.&lt;br /&gt;An SPN consists of 3 parts: a service class (http, mssqlsvc, host, etc.) part, a hostname part&amp;nbsp;and an optional port part. If you are using default ports, you don&amp;#39;t specify the port.&lt;/p&gt;
&lt;p&gt;So if you are running an application on a non default port, for example: &lt;strong&gt;&lt;em&gt;http://intranet.domain.local:81&lt;/em&gt;&lt;/strong&gt; which runs on port 81, you would expect you to register the SPN &lt;strong&gt;&lt;em&gt;http/intranet.domain.local:81&lt;/em&gt;&lt;/strong&gt;,&amp;nbsp;which is how you should do it according to the specifications, however Internet Explorer will not request a ticket for that SPN. It ignores the port part and requests it for &lt;strong&gt;&lt;em&gt;http/intranet.domain.local&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;which is a different spn and will lead to failed Kerberos authentication.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Then why not register it also without the port part?&lt;br /&gt;&lt;/strong&gt;This will not work when you have multiple websites running on the same hostname&amp;nbsp;but with different port numbers and using different application pool identities. Because of the same reasons mentioned in the other KB articles above. (See section: &lt;strong&gt;Register the spn to the machinename&amp;nbsp;and finished right?)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Why aren&amp;#39;t these KB articles the solution?&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;Let&amp;#39;s go back to my dicussion with my customer:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Me&lt;/strong&gt;: &lt;em&gt;&amp;quot;Do not use CNAME dns records and non default web ports when using Kerberos!&amp;quot;&lt;br /&gt;&lt;/em&gt;&lt;strong&gt;Customer&lt;/strong&gt;: &amp;quot;&lt;em&gt;Yeah, we know that. But we have implemented KB911149, KB938305 and/or KB908209 (and maybe even some others) on all our desktops. So we shouldn&amp;#39;t have a problem.&lt;/em&gt;&amp;quot;&lt;br /&gt;&lt;strong&gt;Me&lt;/strong&gt;: &amp;quot;&lt;em&gt;First: You have to deploy that to all your desktops. I rather have a server side fix.&amp;nbsp;But second: it will &lt;strong&gt;only&lt;/strong&gt; fix Internet Explorer (CNAME issue) and some WinInet applications (non default ports issue) including IE.&amp;quot; &lt;br /&gt;&lt;strong&gt;Customer&lt;/strong&gt;: &amp;quot;We only use Internet Explorer and no other browsers and everyone is using the same version. So what&amp;#39;s the problem?&amp;quot;&lt;br /&gt;&lt;/em&gt;&lt;strong&gt;Me&lt;/strong&gt;&lt;em&gt;: &amp;quot;The problem is that you think that Internet Explorer is your only client!&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Be aware here that I usually operate in SharePoint environments. It might be different when dealing in other ecosystems.&lt;br /&gt;With SharePoint we are not dealing with Internet Explorer only. But also with Office Applications, SharePoint designer, WebDAV Redirector, etc. Some of these applications will not be fixed with above articles. But there is even another very import framework that doesn&amp;#39;t get fixed by this: &lt;strong&gt;The .NET Framework!!!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Every .NET application that does a webrequest to a Kerberos enabled website will not be influenzed by these KB articles. And the .Net framework has the same problems: In most scenario&amp;#39;s it doesn&amp;#39;t use CNAME records to request SPN&amp;#39;s and it will never use the port numbers in the SPN request.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customer&lt;/strong&gt;: &amp;quot;&lt;em&gt;But we don&amp;#39;t have 3rd party applications or even custom .Net applications! So we are ok, right?&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;SharePoint itself was build&amp;nbsp;on the&amp;nbsp;.NET framework. So when you are using Excel Services,SharePoint integrated&amp;nbsp;Reporting Services (with integrated security), RSS&amp;nbsp;Viewer Webpart to view authenticated RSS feeds from different&amp;nbsp;SharePoint farms or from the same farm in a loadbalanced scenario&amp;nbsp;you will run into these problems. Also scenario&amp;#39;s where commercial applications written in&amp;nbsp;.NET&amp;nbsp;are connected to SharePoint like for instance &lt;a target="_blank" href="http://www.k2.com"&gt;K2 workflow&lt;/a&gt; will have these problems. And most customers at one point will use tools that will use the webservices of SharePoint and usually those are build in .NET as well.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Are you sure that the .Net Framework are not effected by these KB articles?&lt;/h2&gt;
&lt;p&gt;Yep. All web requests in .NET will use the&amp;nbsp;&lt;em&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx"&gt;System.Net.WebRequest&lt;/a&gt;&lt;/em&gt; class or descendant classes&amp;nbsp;eventually. This class will not&amp;nbsp;use the WinInet functions to request a Kerberos ticket, but will call the &lt;em&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/aa375506(VS.85).aspx"&gt;InitializeSecurityContext&lt;/a&gt;&lt;/em&gt; function and related functions from&amp;nbsp;&lt;em&gt;secur32.dll&lt;/em&gt;&amp;nbsp;directly. One of the parameters of that function is&amp;nbsp;&lt;strong&gt;&lt;em&gt;pszTargetName.&lt;/em&gt;&lt;/strong&gt; When Kerberos is used that parameter&amp;nbsp;is used to pass the SPN to the function. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So where does the .Net Framework get the SPN from?&amp;nbsp;&lt;br /&gt;&lt;/strong&gt;It will&amp;nbsp;get that from the method &lt;strong&gt;&lt;em&gt;GetComputeSPN(HttpWebRequest httpWebRequest)&amp;nbsp;&lt;/em&gt;&amp;nbsp;&lt;/strong&gt;of the class &lt;strong&gt;&lt;em&gt;System.Net.AuthenticationState,&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;which is an internal class. That method will&amp;nbsp;build the&amp;nbsp;SPN based on the HttpWebRequest. There are however 3 distinct code paths that will return different&amp;nbsp;SPN&amp;#39;s based on input like: is the url&amp;nbsp;a CNAME or HOST A,&amp;nbsp;do we use a proxy server and is the url a&amp;nbsp;Fully Qualified Domain Name (FQDN).&lt;/p&gt;
&lt;p&gt;Below is the source code of this function in version 3.5 of .NET (latest version) to show the different paths. (Thanks to source code tracing of .Net Framework code in Visual Studio &lt;img src="http://blog.michelbarneveld.nl/emoticons/emotion-2.gif" alt="Big Smile" /&gt;)&lt;br /&gt;The 3 paths are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Not using a proxy server.&lt;/li&gt;
&lt;li&gt;Using a proxy server&amp;nbsp;and the Url of the request is&amp;nbsp;an IP Address (e.g.: http://1.2.3.4) or &amp;nbsp;a FQDN (e.g.: &lt;a href="http://portal.mb.local"&gt;http://portal.mb.local&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Using a proxy server and the Url of the request is a short name (e.g.: &lt;a href="http://portal"&gt;http://portal&lt;/a&gt;)&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/GetComputeSpn_5F00_codepath.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/GetComputeSpn_5F00_codepath.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/GetComputeSpn.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Each of these 3 code path&amp;#39;s uses a different assignment of the returning spn value:&lt;/p&gt;
&lt;p&gt;1 (red): spn = httpWebRequest.ServicePoint.Hostname;&lt;br /&gt;2 (blue): spn = httpWebRequest.ChallengedUri.Host;&lt;br /&gt;3 (yellow): spn = Dns.InternalGetHostByName(spn).HostName;&lt;/p&gt;
&lt;p&gt;Path 1 and 3 will&amp;nbsp;&lt;strong&gt;NOT&lt;/strong&gt;&amp;nbsp;&lt;strong&gt;USE&lt;/strong&gt; the CNAME. They do a&amp;nbsp;GetHostByName&amp;nbsp;to&amp;nbsp;get the&amp;nbsp;name the&amp;nbsp;CNAME is pointing at. (You can&amp;#39;t see it here that path 1 is using a GetHostByName, but&amp;nbsp;this is&amp;nbsp;done in another function)&lt;br /&gt;Path 2 however&amp;nbsp;&lt;strong&gt;DOES&lt;/strong&gt;&amp;nbsp;&lt;strong&gt;USE&lt;/strong&gt;&amp;nbsp;the CNAME.&lt;/p&gt;
&lt;p&gt;So below table will summarize which SPN&amp;#39;s are created based on the parameters: FQDN, Proxy, CNAME&lt;/p&gt;
&lt;p&gt;
&lt;table cellpadding="0" cellspacing="0" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;Url&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;DNS Type&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;Using Proxy&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;Code Path&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;&lt;strong&gt;SPN&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;HOST A&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;No&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;HOST A&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;Yes&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;2&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;CNAME&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;No&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/hostname.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;CNAME&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;Yes&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;2&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;HOST A&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;No&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;HOST A&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;Yes&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;3&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/portal.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;CNAME&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;No&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/hostname.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="208" valign="top"&gt;
&lt;p&gt;http://portal&lt;/p&gt;
&lt;/td&gt;
&lt;td width="67" valign="top"&gt;
&lt;p&gt;CNAME&lt;/p&gt;
&lt;/td&gt;
&lt;td width="48" valign="top"&gt;
&lt;p&gt;Yes&lt;/p&gt;
&lt;/td&gt;
&lt;td width="45" valign="top"&gt;
&lt;p&gt;3&lt;/p&gt;
&lt;/td&gt;
&lt;td width="271" valign="top"&gt;
&lt;p&gt;http/hostname.mb.local&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So from above code&amp;nbsp;and table we can at least conclude&amp;nbsp;a few&amp;nbsp;things for the .Net framework:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ports are &lt;strong&gt;never &lt;/strong&gt;used to generate the SPN! Always uses default ports.&lt;/li&gt;
&lt;li&gt;Short names in URL&amp;#39;s&amp;nbsp;lead to FQDN names in the SPN!&lt;/li&gt;
&lt;li&gt;If you are using a CNAME it will create a SPN for the hostname, unless you are using a FQDN and a proxy server, than it will use the CNAME!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The last point from above list is also the reason why CNAMES sometimes work when&amp;nbsp;they have a proxy server configured, Internet Explorer has the same behaviour! That&amp;#39;s also the reason why you shouldn&amp;#39;t use Fiddler to debug&amp;nbsp;Kerberos problems, cause it&amp;nbsp;changes the behavour, since Fiddler register itself as a Proxy Server within WinInet. Use a network sniffing tool like the great &lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=983b941d-06cb-4658-b7f6-3088333d062f&amp;amp;displaylang=en"&gt;Network Monitor&lt;/a&gt; from Microsoft.&lt;/p&gt;
&lt;h2&gt;&lt;br /&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;If you use CNAMES and non default ports for web applications you have to be aware of the different behaviours of the different applications. You usually end up doing a lot more configuration&amp;nbsp;and patching clients and servers and having more complex environment. And still it can go *boom* when you introduce new versions or new applications.&lt;/p&gt;
&lt;p&gt;When you use HOST A records and default ports all the applications have the same behaviour and your life as administrator&amp;nbsp;just became easier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=21" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/CNAME/default.aspx">CNAME</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/.Net+Framework/default.aspx">.Net Framework</category></item><item><title>Login failed. (Microsoft SQL Server, Error: 18452)</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/11/11/login-failed-microsoft-sql-server-error-18452.aspx</link><pubDate>Wed, 11 Nov 2009 19:33:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:20</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=20</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=20</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/11/11/login-failed-microsoft-sql-server-error-18452.aspx#comments</comments><description>&lt;p&gt;Today I created a new virtual machine to do some SharePoint 2010 testing. First installed Windows 2008 R2, then added and configured the DNS and Active Directory&amp;nbsp;roles. Installed Sql Server 2008 R2. Started the install of SharePoint 2010. Untill this point everything went very smooth.&amp;nbsp;But during the installation you have to give the database name where the SharePoint databases will be created. And since I didn&amp;#39;t like the hostname,&amp;nbsp;I wanted&amp;nbsp;a dns entry for it with a better name. Should be simple, right? &lt;/p&gt;
&lt;p&gt;Started the dns server management console&amp;nbsp;and added the entry &lt;em&gt;sql.mb.local&lt;/em&gt; pointing to my fixed ip.&amp;nbsp;Used the new name in the SharePoint installation screen and got login failures. &lt;br /&gt;Hmm, what is going on here? Is Sql service running? Did I used the wrong ip? Those all checked out fine. So I started the SQL Server Management Studio. I could connect using the hostname and ip addresses but not through the dns name. If I did that I got a nice little box saying: &lt;em&gt;&lt;strong&gt;&amp;quot;Login Failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)&amp;quot;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Error-18452-Login-Failed.jpg"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Error-18452-Login-Failed.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Searched for the errors on internet and found some blog postings about enabling &lt;strong&gt;Mixed Mode&lt;/strong&gt; &lt;strong&gt;authentication&lt;/strong&gt;, instead of &lt;strong&gt;Windows only authentication&lt;/strong&gt;. But I was sure it must also work with just Windows authentication. Next step was to look in the eventviewer and there was an event &lt;strong&gt;17806&lt;/strong&gt;&amp;nbsp;in the Application Log saying &amp;quot;&lt;em&gt;&lt;strong&gt;SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed&lt;/strong&gt;.&amp;quot;&lt;/em&gt; and in the Security Log there was an event &lt;strong&gt;4625&lt;/strong&gt; saying &amp;quot;&lt;em&gt;&lt;strong&gt;An Error occured during Logon&lt;/strong&gt;&lt;/em&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;I also tried it with a CNAME record as alias for the host name and that worked perfectly. I also checked if there were SPN&amp;#39;s registered to the sql service account. None were registered. Also checked for MSSQLSvc spn in the domain, also none found. But by this time I was convinced it had to be some kind of Kerberos issue or NTLM reflection protection. But in both cases I am still puzzled why using a HOST A record doesn&amp;#39;t work, while the hostname or CNAME does work. But I tried the standard fixes for both problems and they both work (Technically&amp;nbsp;both solutions work for&amp;nbsp;the NTLM reflection protection problem):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Solution 1 - Register a SPN for the SQL Service&lt;/h2&gt;
&lt;p&gt;Execute the following command to register a SPN&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;strong&gt;SetSpn -A MSSQLSvc/sql.mb.local:1433 MB\sql_service&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;(Where &lt;em&gt;&lt;strong&gt;MSSQLSvc&lt;/strong&gt;&lt;/em&gt; is the service class for SQL Server, &amp;nbsp;&lt;em&gt;&lt;strong&gt;sql.mb.local&lt;/strong&gt;&lt;/em&gt; is my dns entry, &lt;em&gt;&lt;strong&gt;1433&lt;/strong&gt;&lt;/em&gt; is the port my sql instance is listening on and&lt;strong&gt; &lt;em&gt;MB\sql_service&lt;/em&gt;&lt;/strong&gt; is the account sql server is running as)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Solution 2 - Disable NTLM reflection protection&lt;/h2&gt;
&lt;p&gt;Create a new &lt;strong&gt;&lt;em&gt;DWORD&lt;/em&gt; &lt;/strong&gt;with the name &lt;strong&gt;&lt;em&gt;DisableLoopbackCheck&lt;/em&gt; &lt;/strong&gt;and value &lt;strong&gt;&lt;em&gt;1&lt;/em&gt;&lt;/strong&gt; in the registry key &lt;strong&gt;&lt;em&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa &lt;/em&gt;&lt;/strong&gt;and restart the computer.&lt;/p&gt;
&lt;p&gt;This will disable NTLM reflection protection on the whole machine, which opens it for Man In The Middle attacks, but on my &lt;strong&gt;test&lt;/strong&gt; machine this is ok ;-)&lt;br /&gt;For production machine reference these KB articles for other ways to disable the protection: &lt;a target="_blank" href="http://support.microsoft.com/kb/887993"&gt;Users experience authentication issues...&lt;/a&gt;&amp;nbsp;and &lt;a target="_blank" href="http://support.microsoft.com/kb/957097/"&gt;MS08-068: Vulnerability in SMB could allow remote code execution&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=20" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Error/default.aspx">Error</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/SQL+Server/default.aspx">SQL Server</category></item><item><title>X-SharePointHealthScore: a new SharePoint 2010 HTTP header</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/11/08/x-sharepointhealthscore-a-new-sharepoint-2010-http-header.aspx</link><pubDate>Sun, 08 Nov 2009 14:29:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:19</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=19</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=19</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/11/08/x-sharepointhealthscore-a-new-sharepoint-2010-http-header.aspx#comments</comments><description>&lt;p&gt;I was testing something with SharePoint 2010 and needed a deeper look on what was actually send over the wire. So I started fiddler and noticed a few HTTP headers in the response that were new to me.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/X_2D00_SharePointHealthScore.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/500x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/X_2D00_SharePointHealthScore.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;The new headers:&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;MicrosoftSharePointTeamServices&lt;br /&gt;&lt;/strong&gt;This header is not really new. It&amp;#39;s been&amp;nbsp;there in previous versions of SharePoint. But the version is new ;-)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SPRequestGuid&lt;br /&gt;&lt;/strong&gt;This turns out to be the Log Correlation Id. With this correlation id you can search the ULS logs for the log lines belonging to this request. Very handy!&lt;br /&gt;It&amp;#39;s also mentioned in the Developer Dashboard:&lt;br /&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Developer_5F00_Dashboard_5F00_Log_5F00_Correlation_5F00_Id.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/Developer_5F00_Dashboard_5F00_Log_5F00_Correlation_5F00_Id.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;X-SharePointHealthScore&lt;br /&gt;&lt;/strong&gt;This one got me puzzled for some time where it&amp;#39;s getting it&amp;#39;s value from. At first I thought it was getting it&amp;#39;s value from the new Health Analyzer Report in Central Admin. But changing the amount of problems in the Health Analyzer&amp;nbsp;didn&amp;#39;t effect the HealthScore. After finding no references on Internet or the SharePoint SDK,&amp;nbsp;it was time to open Reflector and see what is going on.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;What is the X-SharePointHealthScore HTTP Header?&lt;/h2&gt;
&lt;p&gt;It&amp;#39;s a header that returns the systems health (duh) based on these&amp;nbsp;3 performance counters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Memory - Available MBytes&lt;/li&gt;
&lt;li&gt;ASP.NET - Requests Queued&lt;/li&gt;
&lt;li&gt;ASP.NET - Request Wait Time&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are references in the code to the CPU Usage performance counter, but no performance counters are actually being used for that. Maybe&amp;nbsp;some leftover from an earlier build or maybe something that will be added later. And also in the final version of SharePoint there might be other performance counters as well. And maybe&amp;nbsp;we can even add our own counters and thresholds to it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So how does it calculate the Health Score&amp;nbsp;value?&lt;br /&gt;&lt;/strong&gt;Every Performance Counter has an table with 10 score buckets&amp;nbsp;associated with it:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.michelbarneveld.nl/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/ScoreBuckets.png"&gt;&lt;img src="http://blog.michelbarneveld.nl/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/michel/ScoreBuckets.png" border="0" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For example&amp;nbsp;the Memory Score (the top one of the above 3). If you have more than 1000MB&amp;nbsp;available than the Memory gets a score of 0. If the amount of memory available is between 1000MB and 500MB it will get a score of 1, etc. And if there is less than 20MB of memory available it will get a score of 10. The same applies to the other 2 counters. And the score of these 3 counters are added together and returned as the X-SharePointHealthScore. (So currently it will be a value between 0 and 30)&lt;/p&gt;
&lt;h2&gt;What does the Health Score mean or do?&lt;/h2&gt;
&lt;p&gt;One of the new features of SharePoint 2010 is resource throttling when the system is a bit busy handling requests. This can be tuned on&amp;nbsp;at Web Application level in&amp;nbsp;Central Admin. That throttling uses the health score value. If the value becomes 10 or above&amp;nbsp;it will go into&amp;nbsp;throttling mode.&amp;nbsp;At that point it will give GET requests a lower priority than other types like POST. So people&amp;nbsp;can finish the form they are filling in, but new request will be denied.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;What can we do with this Health Score?&lt;/h2&gt;
&lt;p&gt;Besides the obvious for using it to monitor the server. It can also be used in load balancing scenarios (if your loadbalancer can be configured to support this). Based on the healthscores the loadbalancer is able to determine which web front-end has the most ammount of resources left and forward the request to that WFE. &lt;/p&gt;
&lt;p&gt;So how do we test the loadbalancer if we set it up in this fashion? Do we need to DDoS a WFE? &lt;br /&gt;There is a better way ;-) There is a registry setting that will override the Health Score and it will return the value from the registry.&lt;/p&gt;
&lt;p&gt;Create a DWORD with the name &lt;strong&gt;ServerHealthScore &lt;/strong&gt;in the following location: &lt;strong&gt;HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS&lt;/strong&gt; and give it the value you want.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And as a little disclaimer. All above is discovered using reflectoring the beta version of SharePoint. This might be different on the RTM version. ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=19" width="1" height="1"&gt;</description><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Health/default.aspx">Health</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/2010/default.aspx">2010</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/Monitoring/default.aspx">Monitoring</category><category domain="http://blog.michelbarneveld.nl/michel/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>First post!</title><link>http://blog.michelbarneveld.nl/michel/archive/2009/11/08/first-post.aspx</link><pubDate>Sun, 08 Nov 2009 14:26:00 GMT</pubDate><guid isPermaLink="false">48e6dcc1-7275-4f12-a2e5-60ddc1395bc8:18</guid><dc:creator>Michel Barneveld</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/rsscomments.aspx?PostID=18</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.michelbarneveld.nl/michel/commentapi.aspx?PostID=18</wfw:comment><comments>http://blog.michelbarneveld.nl/michel/archive/2009/11/08/first-post.aspx#comments</comments><description>&lt;p&gt;Ok, ok, I am finally convinced. Even I should blog ;-)&lt;br /&gt;So the software is setup and ready, let the inspiration begin.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Michel.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blog.michelbarneveld.nl/aggbug.aspx?PostID=18" width="1" height="1"&gt;</description></item></channel></rss>