<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Care, Share and Grow!</title><link>http://blogs.msdn.com/saurabh_singh/default.aspx</link><description>Troubleshooting tips for IIS, ASP, ASP.Net, SSL and some random thoughts</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Configuring FTP 7.5 with Host Header and SSL</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/11/06/configuring-ftp-7-5-with-host-header-and-ssl.aspx</link><pubDate>Fri, 06 Nov 2009 20:59:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9918806</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9918806.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9918806</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9918806</wfw:comment><description>&lt;p&gt;FTP 7.5 comes with new features like Host header and SSL. I recently saw some cases coming in from our customers on this. Scanning the Internet made me realize that we need more information posted on this as far as the configuration is concerned.&lt;/p&gt;  &lt;p&gt;If you are seeing any of these errors while connecting to an IIS FTP server using SSL/Host header like&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000" size="1"&gt;534-Local policy on server does not allow TLS secure connections.      &lt;br /&gt;Win32 error:&amp;#160;&amp;#160; Access is denied.       &lt;br /&gt;Error details: SSL certificate was not configured.&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;or&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000" size="1"&gt;Primary connection and data connection certificates don't match.      &lt;br /&gt;Error:&amp;#160; Transfer connection interrupted: ECONNABORTED - Connection aborted&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;or &lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000" size="1"&gt;431-Failed to setup secure session.      &lt;br /&gt;Win32 error:&amp;#160;&amp;#160; &lt;br /&gt;Error details: SSL certificate hash has invalid length.&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;or&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000" size="1"&gt;534-Protection level negotiation failed.      &lt;br /&gt;Win32 error:&amp;#160;&amp;#160; Access is denied.       &lt;br /&gt;Error details: Protection negotiation failed. PROT command with recognized parameter must precede this command.&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;then check this blog post &lt;a href="http://blogs.msdn.com/webtopics/archive/2009/11/06/configuring-ftp-7-5-with-host-header-and-ssl.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I wrote this article on our Team blog site hoping it reduces the confusion around this topic. &lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;Ciao!&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9918806" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Host+headers/default.aspx">Host headers</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/SSL/default.aspx">SSL</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/FTP/default.aspx">FTP</category></item><item><title>WWW Service not listed in the Services console (IIS 6.0)?</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/10/23/www-service-not-listed-in-the-services-console-iis-6-0.aspx</link><pubDate>Fri, 23 Oct 2009 00:33:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9911782</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9911782.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9911782</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9911782</wfw:comment><description>&lt;p&gt;This post is a continuation to the &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/tags/service+startup/default.aspx" target="_blank"&gt;series&lt;/a&gt; on IIS service startup issues. I did not feel like writing it since we haven’t seen much cases on this type of behavior and I thought this could be one of those rare issues which always happens with IIS but my customer who bore the brunt of trying to reinstall IIS multiple times without luck virtually forced me into writing it. So here I go…&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Problem Description&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;IIS gets installed successfully on a fresh Win2k3 Server. IISADMIN service is up and running. However we do not see World Wide Service (WWW) listed in the Services console. Hence we cannot start any website. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Resolution&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;If you are seeing a similar behavior as above you may want to follow the steps below.&lt;/p&gt;  &lt;p&gt;1. Check for the default permissions as per this &lt;a href="http://support.microsoft.com/kb/278381" target="_blank"&gt;KB&lt;/a&gt; on &lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;&amp;lt;SystemDrive:&amp;gt;\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;2. Open iis6.log from the location &amp;lt;SystemDrive:&amp;gt;\Windows and look for &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="1"&gt;OC_COMPLETE_INSTALLATION:iis_www:SetupInstallServicesFromInfSection failed.Ret=5&lt;/font&gt;&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;*Return code 5 suggests access denied&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;……………………………&lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;&lt;strong&gt;OC_CLEANUP:InetStartService():ServiceName=W3SVC unable to start &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;&lt;strong&gt;WARNING. Err=0x424&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;&lt;strong&gt;OC_CLEANUP:!FAIL!&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;&lt;strong&gt;OC_CLEANUP:PostInstall of Component 'iis_www' FAILED&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;3. This suggests we are having some permission issues while installing IIS.&lt;/p&gt;  &lt;p&gt;4. Download and run the Process Monitor tool from &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" target="_blank"&gt;here&lt;/a&gt; while reinstalling IIS again from the Add/Remove Components wizard. Ensure we run it only during the install process since it collects a lot of data.&lt;/p&gt;  &lt;p&gt;5. Check for any &lt;em&gt;ACCESS DENIED&lt;/em&gt; entry in the log captured by the Process Monitor tool.&lt;/p&gt;  &lt;p&gt;6. You may see an &lt;em&gt;ACCESS DENIED&lt;/em&gt; for the Registry key &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="1"&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost&lt;/font&gt;&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;Using the Process Monitor tool you can get the identity which does not have the permission. Generally it will be the current logged on user’s credentials running the wizard. Grant Full permission to the Administrators group (assuming that this user trying to install IIS is also a part of this group).&lt;/p&gt;  &lt;p&gt;7. Reinstall IIS and hopefully you should be good.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If this does not help Microsoft PSS support for IIS is always there to help you out ;-)&lt;/p&gt;  &lt;p&gt;Good Luck!!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9911782" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/service+startup/default.aspx">service startup</category></item><item><title>Using System.Net trace configuration file to troubleshoot Certificate errors in ASP.Net</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/09/16/using-system-net-trace-configuration-file-to-troubleshoot-certificate-errors-in-asp-net.aspx</link><pubDate>Wed, 16 Sep 2009 20:46:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9895969</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9895969.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9895969</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9895969</wfw:comment><description>&lt;p&gt;System.Net trace configuration feature in ASP.Net 2.0 onwards is extremely useful when dealing with certificate related errors.&lt;/p&gt;  &lt;p&gt;Jeff P. Sanders from WinInet/System.Net API Escalation team has written this valuable post for troubleshooting ASP.Net certificate related issues.&lt;/p&gt;  &lt;p&gt;I am adding it&amp;#160; here as a quick reference for others and myself.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/jpsanders/archive/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure.aspx" href="http://blogs.msdn.com/jpsanders/archive/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure.aspx"&gt;http://blogs.msdn.com/jpsanders/archive/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Great article!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9895969" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/SSL/default.aspx">SSL</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Certificate/default.aspx">Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/.Net/default.aspx">.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/reference/default.aspx">reference</category></item><item><title>Been away for a while…</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/08/30/been-away-for-a-while.aspx</link><pubDate>Sun, 30 Aug 2009 15:10:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9889086</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9889086.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9889086</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9889086</wfw:comment><description>&lt;p&gt;I was away for a while now in the wilderness of the Himalayas.    &lt;br /&gt;I was out covering Leh, Ladakh and Kashmir by road (alas, not biking which I badly missed).     &lt;br /&gt;Ladakh is one of those places one should not miss and that too its journey via road. It has its own esoteric beauty     &lt;br /&gt;comprising of barren landscapes, rocky mountains stripped of vegetations, deserts and rivers. A must for adventure     &lt;br /&gt;trip enthusiasts. &lt;/p&gt;  &lt;p&gt;Here are some snaps from the places I was at during this trip. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Beenawayforawhile_F6A3/IMG_6762.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_6762" border="0" alt="IMG_6762" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Beenawayforawhile_F6A3/IMG_6762_thumb.jpg" width="200" height="260" /&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Beenawayforawhile_F6A3/IMG_6933.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_6933" border="0" alt="IMG_6933" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Beenawayforawhile_F6A3/IMG_6933_thumb.jpg" width="260" height="200" /&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Beenawayforawhile_F6A3/IMG_7081.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_7081" border="0" alt="IMG_7081" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Beenawayforawhile_F6A3/IMG_7081_thumb.jpg" width="200" height="260" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt; I wasn't able to respond to comments from people on various posts during this time. I will ensure all of them are   &lt;br /&gt;taken care of at the earliest.   &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Cheers to life!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9889086" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Personal/default.aspx">Personal</category></item><item><title>Required permissions when calling a Web service using client certificate for authentication in an ASP.NET Web application</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/07/03/required-permissions-when-calling-a-web-service-using-client-certificate-for-authentication-in-an-asp-net-web-application.aspx</link><pubDate>Fri, 03 Jul 2009 04:08:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9815515</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9815515.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9815515</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9815515</wfw:comment><description>&lt;p&gt;A Web service requiring Client certificate authentication is a common scenario.&lt;/p&gt; &lt;p&gt;You may have a client application which needs to send the Client certificate as part of the web request for accessing the web service.&lt;/p&gt; &lt;p&gt;This client application may be a Windows/Console application or another Web application.&lt;/p&gt; &lt;p&gt;Often you will get into issues wherein you are able to send Client certificate as part of the web request from a windows/console app but not from another web app. The primary reason for this could often be around Web app not being able to send the client cert to the target Web service.&lt;/p&gt; &lt;p&gt;This can happen for multiple reasons, in particular account under which Web app is running doesn't have enough permissions to access the Client cert in its local certificate store.&lt;/p&gt; &lt;p&gt;Refer to this excellent &lt;a title="901183" href="http://support.microsoft.com/?id=901183" target="_blank"&gt;kb&lt;/a&gt; for this for more details.&lt;/p&gt; &lt;p&gt;In this post I want to highlight ways in which you can grant access to the Web application account to access the Client certificate in its local machine store.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;When we have to send client cert as part of the web service call from a web app we need to ensure that the client cert is installed in the Local Computer -&amp;gt; Personal Store on the local box (where Web app is running). By default you will see the client cert installed in the Local User Store for the user who requested and installed the cert on the machine. You need to ensure first that the client cert is installed on the Local Computer Store instead of the Local User Store and then follow any of the methods below to grant access to the private key for the account (under which your web app is running).&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method 1:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The above article &lt;a title="901183" href="http://support.microsoft.com/?id=901183" target="_blank"&gt;kb&lt;/a&gt; gives an example of granting access using the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=c42e27ac-3409-40e9-8667-c748e422833f&amp;amp;displaylang=en" target="_blank"&gt;Microsoft Windows HTTP Services Certificate Configuration Tool&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;/b&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;b&gt;&amp;gt; WinHttpCertCfg.exe -g -c LOCAL_MACHINE\MY -s " &lt;var&gt;IssuedToName &lt;/var&gt;" -a " &lt;var&gt;AccountName &lt;/var&gt;"&lt;/b&gt;&lt;/p&gt; &lt;p&gt;for e.g. &lt;/p&gt; &lt;p&gt;&lt;b&gt;&amp;gt; WinHttpCertCfg.exe -g -c LOCAL_MACHINE\MY -s " &lt;var&gt;IssuedToName &lt;/var&gt;" -a "Network Service" &lt;/b&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;There are other ways in which you can achieve the same result. This feature is in fact built in on Windows Server 2008 within the Certificate mmc console.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method 2:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Using the WSE X509 Certificate tool (This tool has features that can be used to check certificate properties).&lt;/p&gt; &lt;p&gt;You need to &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1ba1f631-c3e7-420a-bc1e-ef18bab66122&amp;amp;displaylang=en" target="_blank"&gt;download&lt;/a&gt; Web Services enhancements (WSE) 2.0+ SP3 for Microsoft.Net and in the install wizard ensure you select Tools as shown below:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="381" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_thumb.png" width="504" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once installed go ahead and launch the tool. It has a clean UI. You have the option to check certificates in the Local Computer/Current user for the available stores like Personal/Trusted/Intermediate Root CA etc. If you click on View Private Key File Properties (shown below) you can directly modify the permission for private key associated with the certificate. Basically this is just a file under &lt;em&gt;C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys&lt;/em&gt; on Win2k3 server and&amp;nbsp; &lt;em&gt;C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys&lt;/em&gt; on Win2k8 server.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="539" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_thumb_4.png" width="551" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You may want to go ahead and give the Service account under which the web app is running Full permission on this file (modify the permissions from the Security tab).&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method 3:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;If you are running the web app on Windows Server 2008/Vista there is a far simpler way built in the Certificate mmc.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="312" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4e6e8ea9250e_4A38/image_thumb_5.png" width="572" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Right click on the certificate and go to All Tasks -&amp;gt; Manage Private Keys and then give Full permission for the associated account.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Till next time..&lt;/p&gt; &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9815515" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>Avoid this confusion around Client certificate mapping in IIS 6.0/7.0</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/06/13/avoid-this-confusion-around-client-certificate-mapping-in-iis-6-0-7-0.aspx</link><pubDate>Sat, 13 Jun 2009 03:05:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9740648</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9740648.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9740648</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9740648</wfw:comment><description>&lt;p&gt;I just wanted to add this quick post around &lt;strong&gt;Client certificate Mapping&lt;/strong&gt; on IIS. This is focused on 1-to-1/Many-to-1 mapping in IIS 6.0/7.0.&lt;/p&gt; &lt;p&gt;If you are interested to know more about configuring Client certificate mapping in IIS 6.0 please check this &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/04/14/how-to-setup-iis-and-ad-for-client-certificate-setup-and-authentication.aspx" target="_blank"&gt;post&lt;/a&gt; of mine and for IIS 7.0 this is an excellent &lt;a href="http://blogs.iis.net/rlucero/archive/2008/05/23/iis-7-walkthrough-one-to-one-client-certificate-mapping-configuration.aspx" target="_blank"&gt;article&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;Recently a &lt;a href="http://blogs.msdn.com/rakkimk/" target="_blank"&gt;colleague&lt;/a&gt; of mine and I was working on this issue for one of our internal teams and after some real slogging we figured out that one *cannot* set this mapping at any Virtual directory/Application level in IIS.&lt;/p&gt; &lt;p&gt;One has to set the Client certificate mapping at the specific Web site level only!&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="41" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_thumb.png" width="149" border="0"&gt;&lt;/a&gt; This is wrong!&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="39" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/7535c5fca462_4A3D/image_thumb_1.png" width="144" border="0"&gt;&lt;/a&gt; This is right!&lt;/p&gt; &lt;p&gt;I couldn't find a documentation on this so thought of putting this as a short post for general audience in case someone is scratching their head over this.&lt;/p&gt; &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9740648" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Authentication/default.aspx">Authentication</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Visual Studio 2005/2008 IDE: Web Controls in the Toolbox seen grayed out for Asp.Net projects ?</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/04/23/visual-studio-2005-2008-ide-web-controls-in-the-toolbox-seen-grayed-out-for-asp-net-projects.aspx</link><pubDate>Thu, 23 Apr 2009 03:28:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9563619</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9563619.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9563619</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9563619</wfw:comment><description>&lt;p&gt;Here is a quick post that may help you save few hours if you get into this problem.&lt;/p&gt; &lt;p&gt;&lt;u&gt;Symptoms&lt;/u&gt;&lt;/p&gt; &lt;p&gt;-- Out of blue you realize that when you try to create and open a new Web&amp;nbsp; site/Web Application project we do not see any of the Web controls in the Toolbox. It includes most of the sections in the Toolbox pane including Common controls, Data, Login, validation and in fact any of the controls which are associated with an Asp.Net web page.&lt;/p&gt; &lt;p&gt;-- When you click on 'Show All' in the toolbox you see all the Asp.Net related controls grayed out. In fact you will see most if not all, of the sections in the toolbox being grayed out except HTML controls.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/8ee2548b9714_6F3/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="409" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/8ee2548b9714_6F3/image_thumb.png" width="331" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Go to the Source view for the Web form in the VS IDE and add an ASP control yourself like &amp;lt;asp:TextBox...&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/p&gt; &lt;p&gt;Browsing to the web page shows the control getting rendered without any issues. So seems like more of a VS IDE issue than anything to do with ASP.Net application configuration.&lt;/p&gt; &lt;p&gt;-- Creating a new Winform project works fine with all the relevant controls being displayed and working in the Toolbox window.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;u&gt;Resolution&lt;/u&gt;&lt;/p&gt; &lt;p&gt;This issue may happen if by mistake you had associated ASPX pages with the HTML Editor in the VS IDE. It should be ideally associated with the Web form Editor.&lt;/p&gt; &lt;p&gt;To resolve this, In the Solution Explorer, locate the ASPX that we are working on, right click on the page and select 'Open with...'.&lt;/p&gt; &lt;p&gt;You may be seeing that the current selection is HTML Editor (Default). Change it Web Form Editor and click on 'Set as Default'.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/8ee2548b9714_6F3/image_8.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="366" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/8ee2548b9714_6F3/image_thumb_3.png" width="564" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Close the current VS IDE and re-launch it and now we should *hopefully* be good.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9563619" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Automate client certificate one-to-one mapping in IIS 6.0 using C#</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/04/11/automate-client-certificate-one-to-one-mapping-in-iis-6-0-using-c.aspx</link><pubDate>Sat, 11 Apr 2009 03:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9544308</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>21</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9544308.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9544308</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9544308</wfw:comment><description>&lt;P&gt;In PSS, we occasionally get requests from our customers wherein they want to automatically add entries for client certificate mapping in IIS or Active Directory (AD). That is either a 1-to-1, Many-to-1 or AD mapping for the client certificate authentication for the web site. I recommend going with AD mapping because that eases the management but it finally depends upon one's need.&lt;/P&gt;
&lt;P&gt;I am not sure but I feel there is a security breach plus annoyance when an administrator has to laboriously enter the mappings for all the accounts/certificates (I am being specific to 1-to-1/Many-to-1 here). &lt;/P&gt;
&lt;P&gt;The concern I feel when dealing with the administrator doing it for 1-to-1 and Many-to-1 are:&lt;/P&gt;
&lt;P&gt;a. If there are hundreds of users you need to do this manually for everyone of those accounts and it's a pain.&lt;/P&gt;
&lt;P&gt;b. Yes, the above can be automated using a script but then the second concern that arises is that whoever is running the script has to know the passwords for all these accounts to be mapped. I think this doesn't sound good.&lt;/P&gt;
&lt;P&gt;I have written a sample application using which users can enter the mappings themselves in the IIS's Client certificate setting, i.e. entries having the client certificate mapped to a windows account (either a local IIS or AD account) and the corresponding password. &lt;/P&gt;
&lt;P&gt;So this is how it works:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;User accesses this web page from their workstation which already has the client certificate installed. 
&lt;LI&gt;They are authenticated over Basic with SSL. 
&lt;LI&gt;Browser sends across the client certificate as part of the HTTP web request. 
&lt;LI&gt;This application gathers the user account, password plus the client certificate from the incoming HTTP web request and does the mapping in IIS.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=760 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_thumb.png" width=617 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b5fb3b4c2db3_3557/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I am adding the code here in case someone may want to extract the section for automated scripting instead of using it as a web app.&lt;/P&gt;
&lt;P&gt;This code is also attached to this post as well.&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4"&gt;
&lt;DIV style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Data;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Configuration;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.Security;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Security.Cryptography.X509Certificates;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI.WebControls;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI.WebControls.WebParts;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.Web.UI.HtmlControls;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; System.DirectoryServices;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;/* This sample application is to automate One-to-One Client certificate mapping in IIS 6.0.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * User should be able to access this site from the browser and select the client certificate&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * in their machine which will be mapped to their account on the IIS server for 1-to-1 mapping. &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * You need to deploy this application on the IIS server which is hosting the website(s) which &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * needs client certificate mapping, preferably under its own virtual directory.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * Important:&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - Have the authentication for this web application configured to use Basic along with SSL.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - Have the "Accept client certificates" or "Require client certificates" selected under &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   &amp;lt;Website&amp;gt; -&amp;gt; Properties -&amp;gt; Directory Security -&amp;gt; Secure communications -&amp;gt; Edit -&amp;gt; Client certificates&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - Ensure the website that we want the mapping for is mentioned in the web.config file associated with&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   this application under &amp;lt;appSettings&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - In the Web.config file we are impersonating an Administrator account for this application. &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   &amp;lt;identity impersonate="true" userName="Administrator" password="myadminpassword"/&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   This is done because non-admin users cannot modify the IIS metabase. If you do not want users to map&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   entries themselves through web page you can change this to &amp;lt;identity impersonate="true" /&amp;gt;.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   In such a case only admins can add the mappings for their user accounts. Non-admins won't be able to &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   add the client mapping entries.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   This is valid for both domain or local Windows NT accounts.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - This app is written using .Net 2.0, ASP.Net 2.0 and above in mind. You should be able to make it work&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *   with ASP.Net 1.1 as well.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * - You may prefer to run this application under its own dedicated application pool to ensure stability and security.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; * DISCLAIMER: The code is not tested for production scenarios so use it at your own risk. &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *             In case one wants to use batch scripting etc or some kind of console app instead &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; *             of web app you can extract the code section from this page which should work fine for the job.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt; */&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; _Default : System.Web.UI.Page &lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;{&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Page_Load(&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; sender, EventArgs e)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;      {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;B&amp;gt;Client Certificate One-to-One Mapping Application:&amp;lt;/B&amp;gt;&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Serial number: "&lt;/SPAN&gt; + Request.ClientCertificate.SerialNumber + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Issuer: "&lt;/SPAN&gt; + Request.ClientCertificate.Issuer + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Subject Name: "&lt;/SPAN&gt; + Request.ClientCertificate.Subject + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (Request.ClientCertificate.IsPresent)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Validity&amp;lt;BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Not before: "&lt;/SPAN&gt; + Request.ClientCertificate.ValidFrom + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Not after: "&lt;/SPAN&gt; + Request.ClientCertificate.ValidUntil + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;B&amp;gt;There is no client certificate sent along with the request!&amp;lt;/B&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Authenticated User: "&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Authentication Type: "&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_TYPE"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/BR&amp;gt;&amp;lt;HR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Button1_Click(&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; sender, EventArgs e)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; user = Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;];&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; password = Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_PASSWORD"&lt;/SPAN&gt;];&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; clientCertMappingName = &lt;SPAN style="COLOR: #006080"&gt;"Mapping for "&lt;/SPAN&gt; + user;  &lt;SPAN style="COLOR: #008000"&gt;// &amp;lt;--- Our One-to-One Mapping name for the entry&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        HttpClientCertificate cert = Request.ClientCertificate;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #008000"&gt;/*&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          If you want to map a client certificate located on the disk instead of the one as part of the &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          HTTP Web request try the code below.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          X509Certificate certificate = X509Certificate2.CreateFromCertFile(@"c:\cert.cer");&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          X509Certificate certificate = cert.Certificate;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;          byte[] certHash = certificate.GetRawCertData();&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;        */&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;byte&lt;/SPAN&gt;[] certHash = Request.ClientCertificate.Certificate;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #008000"&gt;//Get the name of the Web site for which mapping has to be done from the App settings in the web.config file.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; friendlyWebsiteName = ConfigurationManager.AppSettings[&lt;SPAN style="COLOR: #006080"&gt;"websitename"&lt;/SPAN&gt;].ToString();&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #008000"&gt;//Get the Site Identifier based on the friendly name of the Web Site.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; siteId = getsiteid(friendlyWebsiteName);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (siteId != &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; sitePath = &lt;SPAN style="COLOR: #006080"&gt;"IIS://localhost/W3SVC/"&lt;/SPAN&gt; + siteId + &lt;SPAN style="COLOR: #006080"&gt;"/IIsCertMapper"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; (DirectoryEntry de = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; DirectoryEntry(sitePath))&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;                de.Invoke(&lt;SPAN style="COLOR: #006080"&gt;"CreateMapping"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;[] { certHash, user, password, clientCertMappingName, &lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt; });&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Account Mapped: &amp;lt;B&amp;gt;"&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/B&amp;gt;&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Mapping Name: &amp;lt;B&amp;gt;"&lt;/SPAN&gt; + &lt;SPAN style="COLOR: #006080"&gt;"Mapping for "&lt;/SPAN&gt; + Request.ServerVariables[&lt;SPAN style="COLOR: #006080"&gt;"AUTH_USER"&lt;/SPAN&gt;] + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/B&amp;gt;&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"Web Site: &amp;lt;B&amp;gt;"&lt;/SPAN&gt; + friendlyWebsiteName + &lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;/B&amp;gt;&amp;lt;/BR&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"&amp;lt;B&amp;gt;Web Site does not have a valid Site ID. Ensure we have the correct site name in the config file for this app.&amp;lt;/B&amp;gt;"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        &lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (System.Runtime.InteropServices.COMException)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"A COM exception occurred while setting up the mapping."&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (SystemException)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"An error occurred while setting up the mapping."&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (Exception)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            Response.Write(&lt;SPAN style="COLOR: #006080"&gt;"An error occurred while setting up the mapping."&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;       &lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; getsiteid(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; websitename)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        DirectoryEntry root = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; DirectoryEntry(&lt;SPAN style="COLOR: #006080"&gt;"IIS://localhost/W3SVC"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; siteid = &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;foreach&lt;/SPAN&gt; (DirectoryEntry de &lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt; root.Children)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;                &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (de.SchemaClassName == &lt;SPAN style="COLOR: #006080"&gt;"IIsWebServer"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;                {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;                    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (websitename.ToUpper() == de.Properties[&lt;SPAN style="COLOR: #006080"&gt;"ServerComment"&lt;/SPAN&gt;].Value.ToString().ToUpper())&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;                        siteid = de.Name;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;                }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (siteid == &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;) &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; siteid;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;        &lt;SPAN style="COLOR: #0000ff"&gt;finally&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        {&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;            root.Close();&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;        }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;    }&lt;/PRE&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ciao&lt;/P&gt;
&lt;P&gt;Nice weekend!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9544308" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/saurabh_singh/attachment/9544308.ashx" length="3384" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Client+Certificate/default.aspx">Client Certificate</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Code+Sample/default.aspx">Code Sample</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Tools/default.aspx">Tools</category></item><item><title>Unable to load DLL 'bcrypt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/04/08/unable-to-load-dll-bcrypt-dll-the-specified-module-could-not-be-found-exception-from-hresult-0x8007007e.aspx</link><pubDate>Thu, 09 Apr 2009 01:38:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9539093</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9539093.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9539093</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9539093</wfw:comment><description>&lt;p&gt;I recently had the privilege to get access to a machine from a colleague of mine. It was a Windows server 2003 server and I had to test some ASP.Net application for one of my pet projects. I was focusing completely on the project at hand before I was completely taken off by a surprise, although not a pleasant one.&lt;/p&gt; &lt;p&gt;I found that my application was throwing the following exception, in fact forget my own application even a test Asp.Net 2.0 page having just a one word was failing. Also this happened for web resources hosted directly in IIS. If you run this app from within Cassini (ASP.Net Web server) you may not see this issue at all. This happened for both Website as well as WAP based applications hosted in IIS.&lt;/p&gt; &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to load DLL 'bcrypt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.DllNotFoundException: Unable to load DLL 'bcrypt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[DllNotFoundException: Unable to load DLL 'bcrypt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)]
   Microsoft.Win32.Win32Native.BCryptGetFipsAlgorithmMode(Boolean&amp;amp; pfEnabled) +0
   System.Security.Cryptography.Utils.get_FipsAlgorithmPolicy() +140
   System.Security.Cryptography.RijndaelManaged..ctor() +13
   System.Web.Configuration.MachineKeySection.ConfigureEncryptionObject() +232
   System.Web.Configuration.MachineKeySection.EnsureConfig() +156
   System.Web.Configuration.MachineKeySection.GetEncodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32&amp;amp; length) +37
   System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +166
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +4
   System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +37
   System.Web.UI.HiddenFieldPageStatePersister.Save() +79
   System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +105
   System.Web.UI.Page.SaveAllState() +236
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1099

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 &lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This was quite perplexing as I couldn't find much information on this across the net. One incident I found talked about un-installation of&amp;nbsp; &lt;a href="http://support.microsoft.com/kb/931212" target="_blank"&gt;MS07-040&lt;/a&gt; security update. I was running on .Net framework 2.0 Sp2, Windows Server 2003 SP2. No luck with it. I had no clues about this dll which was missing as in the exception and why the heck it was looking for it in the first place.&lt;/p&gt;
&lt;p&gt;The interesting part here was that the call stack looked like having some encryption/decryption algorithm (RijndaelManaged) being used perhaps related to viewstate. I finally had to disable the attribute EnableViewStateMac="false" for the web page to make it work, but well that may not be an option all the time for everyone.&lt;/p&gt;
&lt;p&gt;If you face such a scenario just don't go ahead with reinstallation of .Net framework 2.0, it may not help you but only drain your precious time.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Analysis/Resolution&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;From this &lt;a href="http://support.microsoft.com/kb/911722" target="_blank"&gt;KB article&lt;/a&gt; this is what RijndaelManaged is all about.&lt;/p&gt;
&lt;p&gt;"ASP.NET 2.0 uses the RijndaelManaged implementation of the AES algorithm when it processes view state data. The ReindaelManaged implementation has not been certified by the National Institute of Standards and Technology (NIST) as compliant with the Federal Information Processing Standard (FIPS). Therefore, the AES algorithm is not part of the Windows Platform FIPS validated cryptographic algorithms."&lt;/p&gt;
&lt;p&gt;To work around this either set EnableViewStateMac to false or else add the following entry as mentioned in the kb under &lt;strong&gt;&amp;lt;system.web&amp;gt;&lt;/strong&gt; section for the web application.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;&amp;lt;machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/&amp;gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ASP.NET use the Triple Data Encryption Standard (3DES) algorithm to process view state data instead of the AES (Rijndael) algorithm. Remember this is comparatively weaker than Rijndael based encryption and hence your application will be comparatively insecure.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;*Note that the error message in the above article is not exactly the same as what I saw here for this post but the resolution remains the same :-).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Till next time..&lt;img alt="Beer mug" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/beer_mug.gif"&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9539093" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category></item><item><title>Asp.Net Request routing implementation fails with Null Reference exception</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/03/19/asp-net-request-routing-implementation-fails-with-null-reference-exception.aspx</link><pubDate>Thu, 19 Mar 2009 21:33:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9490832</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9490832.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9490832</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9490832</wfw:comment><description>&lt;p&gt;I recently had the pleasure of working on the implementation of Asp.Net Request Routing feature that comes in bundled with .Net Framework 3.5 SP1. This is a cool stuff wherein care has been taken to ensure it can be used independently of MVC Framework. It can be used with Dynamic Data as well as implemented for any generic Asp.Net 2.0 application for Request routing functionality.&lt;/p&gt; &lt;p&gt;*Remember this is different from ASP.NET 2.0's URL Mapping.&lt;/p&gt; &lt;p&gt;The aim of this post is so obvious for many but I am writing this post because I couldn't get any pointers on this over the Internet, although I know I should have checked the end resolution in the very beginning; silly of me.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;We were getting the following exception when we we were trying to route a request. Exception was being thrown from within our custom class implementing IRouteHandler.&lt;/p&gt; &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Server Error &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;span style="color: #006080"&gt;'/'&lt;/span&gt; Application. 
________________________________________
Object reference not set to an instance of an &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; more information about the error and &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; it originated &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;.

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; the exception stack trace below. 

Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;.]
   System.Collections.Generic.Dictionary`2.GetEnumerator() +38
   Mycustomdll.Net.RouteHandler`1.GetHttpHandler(RequestContext requestContext) &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; C:\abcdedfgh\myprojectforfun\asdfsdf\Net\RouteHandler.cs:37
   System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +106
   System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +80
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously) +75
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This application was failing for one of my customers in his environment. I was finally able to reproduce this problem locally on one of my machines as well. Found that ideally this should work fine if you have the latest build. 
&lt;p&gt;On debugging found it was failing at the section shown below in the custom Routehandler class while trying to iterate through the RouteValueDictionary collection even though there were items in the collection. It was failing with the null reference exception. &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;RouteHandler&lt;/span&gt;:IRouteHandler
     {
        ...... 
        ......
       &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;IHttpHandler&lt;/span&gt; GetHttpHandler(RequestContext requestContext)
        {
             &lt;span style="color: rgb(0,0,255)"&gt;foreach&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; value &lt;span style="color: rgb(0,0,255)"&gt;in&lt;/span&gt; &lt;strong&gt;&lt;u&gt;requestContext.RouteData.Values&lt;/u&gt;&lt;/strong&gt;) &amp;lt;------------
             {
                 .....
             }
             .....
             .....
             &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;Page&lt;/span&gt;)BuildManager.CreateInstanceFromVirtualPath(VirtualPath, &lt;span style="color: rgb(0,0,255)"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(43,145,175)"&gt;Page&lt;/span&gt;));
        }
     } &lt;/pre&gt;
&lt;p&gt;You may see this crash behavior if you are running with the build version of System.Web.routing as shown below. I assume this is from the ASP.Net 3.5 SP1 Beta release, not sure.&amp;nbsp; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/c394b3dfef01_9AF4/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="499" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/c394b3dfef01_9AF4/image_thumb.png" width="405" border="0"&gt;&lt;/a&gt; 
&lt;p&gt;In order to rectify this issue ensure you move to the latest build for System.Web.Routing.dll as well as for System.Web.Abstractions.dll. 
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/c394b3dfef01_9AF4/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="499" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/c394b3dfef01_9AF4/image_thumb_1.png" width="365" border="0"&gt;&lt;/a&gt; 
&lt;p&gt;Lesson: Never try to run Beta/CTP version etc. on the production environment. Ensure you have the latest bits deployed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img alt="Coffee-cup" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/coffee.gif"&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9490832" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Considering hosting Web based services on IIS 7.0?</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/03/10/considering-hosting-web-based-services-on-iis-7-0.aspx</link><pubDate>Tue, 10 Mar 2009 19:35:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9469280</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9469280.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9469280</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9469280</wfw:comment><description>&lt;p&gt;If you are contemplating to move over (upgrade) to IIS 7.0 from your existing Web hosting on either IIS 5.0 or 6.0 this is a very useful Technical White Paper link. It talks about various aspects of improvements in IIS 7.0 dealing with Management, Performance, Extensibility, Security and Deployment.&lt;/p&gt; &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc500981.aspx" target="_blank"&gt;Migrating a Large, High-Volume Web Site to Internet Information Services 7.0&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9469280" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS+7.0/default.aspx">IIS 7.0</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>Some Info around WebDAV content access issues</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/03/07/some-info-around-webdav-content-access-issues.aspx</link><pubDate>Sat, 07 Mar 2009 04:15:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9463718</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9463718.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9463718</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9463718</wfw:comment><description>&lt;p&gt;If you have a Web folder (WebDAV) hosted on IIS using Basic Authentication there are a few things you need to ensure such that any client accessing the resource does not get into failures.  &lt;p&gt;If your WebDAV site is restricted using Basic authentication and you are trying to access it over HTTP, access may fail. Over HTTP it may keep prompting you for authentication or else will show the following error:  &lt;p&gt;&lt;strong&gt;"Internet Explorer could not open http://ComputerName/WebDav as a Web &lt;/strong&gt; &lt;p&gt;&lt;strong&gt;Folder. Would you like to see its default view instead?"&lt;/strong&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4555d3e5097e_556F/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="163" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4555d3e5097e_556F/image_thumb_1.png" width="493" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Windows Vista will fail to connect to the server using Basic authentication which is insecure over the network. Vista/XP requires SSL connection to be used with Basic. However you can connect to the Web folder if you set the following registry key on the client machine to 2.  &lt;p&gt;&lt;em&gt;&lt;strong&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel&lt;/strong&gt;&lt;/em&gt;  &lt;p&gt;The BasicAuthLevel can be set to the following values:  &lt;ul&gt; &lt;li&gt;0 - Basic authentication disabled  &lt;li&gt;1 - Basic authentication enabled for SSL shares only (Default) &lt;li&gt;2 or greater - Basic authentication enabled for SSL shares and for non-SSL shares &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Check this article for more on this &lt;a href="http://support.microsoft.com/kb/Q841215" target="_blank"&gt;Q841215&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Also You may not be able to edit an Office 2007 document from within a Web folder from your client. In such a case ensure the following registry key is set:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Internet\OpenDocumentsReadWriteWhileBrowsing&lt;/em&gt;&lt;/strong&gt; = 1 &lt;p&gt;Refer to this &lt;a href="http://support.microsoft.com/kb/870853" target="_blank"&gt;Q870853&lt;/a&gt; for more around Office 2003/2007. &lt;p&gt;* If you are still having issues editing the Office document ensure that there is no Certificate Security alert or Error when browsing to the same Web folder URL. If you do see a security alert because of any of the three reasons associated with it ensure they are fixed.&amp;nbsp; &lt;p&gt;Also these should be handy for other WebDAV related issues, KB&lt;a title="http://support.microsoft.com/kb/912152" href="http://support.microsoft.com/kb/912152"&gt;912152&lt;/a&gt; and KB&lt;a title="http://support.microsoft.com/kb/900900" href="http://support.microsoft.com/kb/900900"&gt;900900&lt;/a&gt;. &lt;p&gt;&amp;nbsp; &lt;p&gt;Until next time...&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9463718" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/MS+Office/default.aspx">MS Office</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/WebDAV/default.aspx">WebDAV</category></item><item><title>Increase the concurrent connections limit for IIS FTP site if you see server reset</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/02/17/increase-the-concurrent-connections-limit-for-iis-ftp-site-if-you-see-server-reset.aspx</link><pubDate>Tue, 17 Feb 2009 05:43:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9426939</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9426939.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9426939</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9426939</wfw:comment><description>&lt;p&gt;If you have a FTP site hosted on IIS which receives a burst of client connections at specific intervals and you see the connections getting reset from server-end please read on.&lt;/p&gt; &lt;p&gt;Let's say you have over 1500 concurrent FTP client connections being made at every 'n' minute you may see that the IIS FTP server is resetting many of those client connections. From a FTP client (the typical &lt;a href="ftp://ftp.exe"&gt;ftp.exe&lt;/a&gt; from the command prompt) you may see the following:&lt;/p&gt; &lt;p&gt;"&lt;font color="#ff0000"&gt;&lt;strong&gt;Connection closed by remote host&lt;/strong&gt;&lt;/font&gt;"&lt;/p&gt; &lt;p&gt;At other times when there is less load on the server things will look good.&lt;/p&gt; &lt;p&gt;Capturing a network trace may show you that a 3-way handshake between the client and the server is taking place and after that server resets the connection. You don't even get to a point wherein you can enter your credentials to access the FTP site. FTP site's maximum concurrent connections property (MaxConnections) is well above this value.&lt;/p&gt; &lt;p&gt;If you are in a similar scenario wherein a sudden bursts of concurrent client connections is leading to the FTP server resetting the requests you may want to play with some combinations of the settings mentioned below. It may be that you are hitting some connection limit for your server. It may not be the total number of connections being made but the total number of simultaneous connections that is causing the problem. &lt;/p&gt; &lt;p&gt;You will have to play with the following settings on the IIS 6.0 server:&lt;/p&gt; &lt;p&gt;&lt;font color="#800040"&gt;&lt;strong&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters&lt;/strong&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ListenBacklog = xxx (Range: 1 -250, Default: 25)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxPoolThreads = xx (Range: 0 - 4,294,967,295 (unlimited), Default: 4)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableBacklogMonitor=1 &lt;/font&gt; &lt;p&gt;And in the metabase, under /LM/MSFTPSVC/&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#800040"&gt;ServerListenBacklog=”xxx”&lt;/font&gt;  &lt;p&gt;* The ServerListenBacklog property specifies the number of outstanding sockets that can be queued. The value is based on the AcceptEx operating system parameter, and the server size specified in the &lt;a href="http://msdn.microsoft.com/en-us/library/ms525440.aspx"&gt;ServerSize&lt;/a&gt; property. Valid values for this property range from 5 to 500.  &lt;p&gt;Reset IIS after making the above changes.&lt;/p&gt; &lt;p&gt;See this &lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/60a90c91-a8d0-43b6-89db-a431d0ea0cb4.mspx?mfr=true" target="_blank"&gt;link&lt;/a&gt; for more details on the Global registry entries for IIS 6.0.&lt;a title="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/60a90c91-a8d0-43b6-89db-a431d0ea0cb4.mspx?mfr=true" href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/60a90c91-a8d0-43b6-89db-a431d0ea0cb4.mspx?mfr=true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/a&gt;&lt;/p&gt; &lt;p&gt;The ListenBacklog setting in the registry controls how many active connections are queued by winsock if IIS is unable to service new requests.&amp;nbsp; &lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/950e7c03-67a7-438f-b231-ef6e4e6327cc.mspx?mfr=true" target="_blank"&gt;ServerListenBacklog&lt;/a&gt; is used by IIS to proactively create sockets to handle incoming requests. This setting adjusts the number of outstanding sockets that your Web server can queue. Setting ServerListenBacklog to a higher value allows IIS to handle a larger number of requests, while ListenBacklog helps the system &lt;em&gt;buffer&lt;/em&gt; the connection spikes if the number of new connections briefly exceeds what IIS can service immediately.&lt;/p&gt; &lt;p&gt;Although the range for ListenBacklog&amp;nbsp; &amp;amp; ServerListenBacklog is given I had seen a scenario wherein we had to adjust the value to a higher number than the given range. You may need to tweak the combination yourself!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="1"&gt;*I give credit to Rob Patrick from PSS IIS Escalation team for this post&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9426939" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/FTP/default.aspx">FTP</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Getting fatal error LNK1181: cannot open input file 'kernel32.lib'</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/01/30/getting-fatal-error-lnk1181-cannot-open-input-file-kernel32-lib.aspx</link><pubDate>Fri, 30 Jan 2009 10:09:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9384396</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9384396.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9384396</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9384396</wfw:comment><description>&lt;p&gt;I was a happy man until a few hours back when I was playing with some C, C++ programs built using Visual Studio 2008 on my work and home machines. I could write some program on my workstation, copy the solution to my personal laptop at home and thereby continue from where I left in office. Things&amp;nbsp; were good until I installed the latest Windows SDK v6.1 on my Vista laptop while trying my hands on Windows PowerShell. &lt;/p&gt; &lt;p&gt;I realized a day or so later after installing SDK v6.1 that now I could not build my application written in C or C++. I could compile it but not link it during build process from within Visual Studio. Funny though I realized I could not even build a very basic Win32 console application. &lt;/p&gt; &lt;p&gt;I started getting the following error:&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;fatal error LNK1181: cannot open input file 'kernel32.lib'&lt;/strong&gt;&amp;nbsp;&lt;/font&gt;&lt;/em&gt;  &lt;p&gt;I did something while troubleshooting it and now also started seeing:  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Error spawning 'rc.exe'. Project myProject&lt;/font&gt;&lt;/strong&gt;&lt;/em&gt;  &lt;p&gt;I did check on the Internet and found all sorts of reasoning around this. One thing looked clear that installing the latest SDK v6.1 had caused me all these headaches. Some links suggested rebooting the server, some talked about&amp;nbsp; low system&amp;nbsp; memory, some said remove the latest SDK v6.1, and some also suggested to reinstall Visual Studio. But somehow I felt this can be fixed without reinstallation of VS2008 or un-installation of SDK v6.1 or etc etc and etc.  &lt;p&gt;I opened the cool Process Monitor tool and found the following:&lt;/p&gt; &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt; &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28836    11:51:31.5538847    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\VC\lib\kernel32.lib    NAME NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28837    11:51:31.5539987    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\VC\lib\kernel32.lib    NAME NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28839    11:51:31.5542065    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib\kernel32.lib    NAME NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28841    11:51:31.5543630    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib\kernel32.lib    NAME NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28842    11:51:31.5544705    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib\i386\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28844    11:51:31.5545935    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\lib\i386\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28846    11:51:31.5547253    devenv.exe    5528    QueryOpen    D:\Program Files\Microsoft SDKs\Windows\v6.1\lib\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28847    11:51:31.5548633    devenv.exe    5528    QueryOpen    D:\Program Files\Microsoft SDKs\Windows\v6.1\lib\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28848    11:51:31.5550927    devenv.exe    5528    QueryOpen    D:\Program Files\Microsoft SDKs\Windows\v6.1\lib\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28849    11:51:31.5552863    devenv.exe    5528    QueryOpen    D:\Program Files\Microsoft SDKs\Windows\v6.1\lib\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28850    11:51:31.5556190    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\kernel32.lib    NAME NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28851    11:51:31.5559045    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\kernel32.lib    NAME NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28852    11:51:31.5561361    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\lib\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;28853    11:51:31.5563280    devenv.exe    5528    QueryOpen    E:\Program Files\Microsoft Visual Studio 9.0\lib\kernel32.lib    PATH NOT FOUND    &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It was crystal clear that while trying to link Visual Studio was encountering a file not found kind of error and hence could be the resulting failure.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;------ Build started: Project: aa, Configuration: Debug Win32 ------&lt;br&gt;Linking...&lt;br&gt;LINK : fatal error LNK1104: cannot open file 'kernel32.lib'&lt;br&gt;Build log was saved at "file://xxxxxxxxxxx\Visual Studio 2008\Projects\myProject\myProject\Debug\BuildLog.htm"&lt;br&gt;myProject - 1 error(s), 0 warning(s)&lt;br&gt;========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Similarly rc.exe showed NOT FOUND.&lt;/p&gt;
&lt;p&gt;It looked simple yet intriguing as to why the default path was changed for Visual Studio.&lt;/p&gt;
&lt;p&gt;I realized that the path it was trying to look at for these files did not even exist, lest I could just have copied these files to the corresponding location.&lt;/p&gt;
&lt;p&gt;Looked at the Environment variables from Visual Studio 2008 command prompt and found that &lt;strong&gt;&lt;em&gt;WindowsSdkDir&lt;/em&gt;&lt;/strong&gt; environment variable was pointing to D:\Program Files\Microsoft SDKs\Windows\v6.1\ which did not exist.&lt;/p&gt;
&lt;p&gt;Tried changing this to the path where I did find the above files on my box which was pointing to C:\program files\microsoft sdks\windows\v6.0A\ (So yes it pretty much looked like after installing SDK v6.1 my environment variable &lt;strong&gt;&lt;em&gt;WindowsSdkDir&lt;/em&gt;&lt;/strong&gt; had changed). Tried logging off/rebooting, no luck.&lt;/p&gt;
&lt;p&gt;Finally figured out that in order to get things back to normal I had to update the following registry key:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;HKEY_CURRENT_USER\SOFTWARE\Microsoft\MicrosoftSDKs\Windows\CurrentInstallFolder&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;I changed this value to point to the original location which was C:\Program Files\Microsoft SDKs\Windows\v6.0A\ in my case.&lt;/p&gt;
&lt;p&gt;I wasted a lot of time on this, so thought of sharing with a wider audience. &lt;/p&gt;
&lt;p&gt;bye!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9384396" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>New features in SETSPN.EXE on Windows Server 2008</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/01/09/new-features-in-setspn-exe-on-windows-server-2008.aspx</link><pubDate>Fri, 09 Jan 2009 03:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9300964</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9300964.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9300964</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9300964</wfw:comment><description>&lt;P&gt;The version of Setspn.exe that came with Microsoft Windows Server 2000/2003 Support Tools did not have features to detect duplicate SPNs. The new version of Setspn.exe that comes bundled with Windows Server 2008 utilities has some really cool features. For someone dealing with the dreaded Kerberos authentication failure issues on a daily basis like me it's a sigh of relief.&lt;/P&gt;
&lt;P&gt;If you try the following command on the Windows Server 2008 you will see the various new options (or switches) available.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=450 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_thumb.png" width=664 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/Refreshingfeature.EXEONWindowsServer2008_6D9/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Notice the modifiers/switches:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-F = perform the duplicate checking on forestwide level&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-S = add arbitrary SPN after verifying no duplicates exist&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-Q = query for existence of SPN&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-X = search for duplicate SPNs&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Searching for duplicate SPNs using Setspn.exe:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 74.96%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 125px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -X http/www.test.com
Processing entry 0
http/www.test.com is registered on these accounts:
    CN=mstest,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    CN=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,OU=Domain Controllers,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 

found 1 group of duplicate SPNs.
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Searching for the existence of an SPN in the domain:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 75.15%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 205px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -Q http/www.test.com
CN=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,OU=Domain Controllers,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com
    ldap/2334590-45566-113f....
    HOST/&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    HOST/&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;.&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    .......
    .......
CN=mstest,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com 

Existing SPN found!
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Adding an arbitrary SPN after verifying no duplicates exist in the domain: 
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 74.96%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 109px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -S http/www.test.com &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
CN=mstest,CN=Users,.&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;.&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com 

Duplicate SPN found, aborting operation!

&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Adding an arbitrary SPN after verifying no duplicates exist in the forest: 
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 75.15%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; HEIGHT: 141px; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;D:\&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;setspn -F -S http/www.test.com &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;IIS-servername&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
Operation will be performed forestwide, it might take a while.
CN=mstest,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com
CN=mstest1,CN=Users,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-primary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;,DC=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;some-DC-secondary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    http/www.test.com 

Duplicate SPN found, aborting operation! 
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;So what does this mean? It means you no longer have to depend upon boggling commands using LDIFDE or your own custom scripts to find out the duplicate SPNs. This is a good news indeed!&lt;/P&gt;
&lt;P&gt;*Prior to this using Windows Server 2000/2003 Support Tools we could use commands using LDIFDE to find duplicate SPNs as below:&lt;/P&gt;
&lt;P&gt;Syntax:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 85.36%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; HEIGHT: 49px; BACKGROUND-COLOR: #f4f4f4"&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;ldifde -f &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; -d "&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;dc&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #ff0000"&gt;domain-netbiosname&lt;/SPAN&gt;,&lt;SPAN style="COLOR: #ff0000"&gt;dc&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #ff0000"&gt;primary-domain&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;" -l serviceprincipalname -r "(serviceprincipalname=&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;serviceprincipalname-to-check-for-duplicates&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)" -p subtree&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;For example, if the domain name is test.abcd.com and the site URL is http//test.abcd.com command should be as shown below: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 85.25%; CURSOR: text; MAX-HEIGHT: 200px; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; HEIGHT: 39px; BACKGROUND-COLOR: #f4f4f4"&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;ldifde –f C:\log.txt -d "dc=test, dc=abcd, dc=com"-l serviceprincipalname –r "(serviceprinicpalname=http/test.abcd.com)" -p subtree&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;With the newer version of Setspn hopefully the dependency on the above command should reduce drastically.&lt;/P&gt;
&lt;P&gt;Till next time,&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9300964" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx">Kerberos</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setspn/default.aspx">Setspn</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item></channel></rss>