<?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! : Setup</title><link>http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx</link><description>Tags: Setup</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><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>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>7</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>Service Principal Name (SPN) checklist for Kerberos authentication with IIS 7.0</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/12/25/service-principal-name-spn-checklist-for-kerberos-authentication-with-iis-7-0.aspx</link><pubDate>Thu, 25 Dec 2008 04:01:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9252291</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9252291.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9252291</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9252291</wfw:comment><description>&lt;p&gt;In continuation to one of my earlier &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/01/29/kerberos-troubleshooting-from-iis-perspective.aspx" target="_blank"&gt;posts&lt;/a&gt; which focused on IIS 6.0 this post is more about the confusion that may arise around SPNs for setting up Kerberos authentication in IIS 7.0. IIS 7.0 has a new Kernel-mode authentication feature using which the ticket for the requested service is decrypted using Machine account (Local system) of the IIS server. It no longer depends upon the application pool Identity for this purpose by default and in turn improves the performance.  &lt;p&gt;Here is how it looks like.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="207" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_thumb.png" width="534" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/KerberostroubleshootingfromIISperspect.0_7F3B/image_thumb_1.png" width="456" border="0"&gt;&lt;/a&gt;  &lt;p&gt;So what does this mean?  &lt;p&gt;You no longer need to worry about the correlation between HTTP SPNs and the Application pool Identity that was required in the earlier version i.e. IIS 6.0. But that's not blindly true. There has been some confusion whether we don't have to care at all about SPNs or may have to depending upon the settings. Here is a checklist to give more clarity for different scenarios that you may fall under:  &lt;p&gt;&lt;strong&gt;SCENARIO 1a&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;NETWORK SERVICE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with the NetBIOS name, like &lt;font size="1"&gt;http://&lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt;/Default.aspx&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;SPNs will be required ONLY for the IIS machine account: &lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-domainname&amp;gt; for e.g. HOST/myIISserver.mydomain.com&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#804000"&gt;&lt;strong&gt;***Note&lt;/strong&gt;: By default HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; and HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-name&amp;gt; is already added for the machine account when a machine is added to a domain and HTTP forms a part of HOST. So you may not have to do anything special here for SPNs. Everything should be set by default.&lt;/font&gt;&lt;/em&gt;  &lt;p&gt;You can check the set of existing SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt; or directly using a Snap-in like &lt;a href="http://technet.microsoft.com/en-us/library/cc773354.aspx" target="_blank"&gt;Adsiedit.msc&lt;/a&gt;.  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;SCENARIO 1b&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;Custom account for e.g. Domain1\Username1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with the NetBIOS name, like &lt;font size="1"&gt;http://&lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt;/Default.aspx&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;The SPN requirements remain the same as above. You don't have to add SPNs like http/&lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt; for the Domain1\Username1 unlike in IIS 6.0 (where we had to add an SPN of the form http/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; for the Application Pool identity). &lt;/p&gt; &lt;p&gt;SPNs will be required ONLY for the IIS machine account:&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="674"&gt;HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-domainname&amp;gt; for e.g. HOST/myIISserver.mydomain.com&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#804000"&gt;&lt;strong&gt;***Note&lt;/strong&gt;: By default HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; and HOST/&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;.fully-qualified-name&amp;gt; is already added for the machine account when a machine is added to a domain and HTTP forms a part of HOST. So you may not have to do anything special here for SPNs. Everything should be set by default.&lt;/font&gt;&lt;/em&gt;  &lt;p&gt;You can check the set of existing SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &lt;em&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/em&gt; or directly using Snap-in like &lt;a href="http://technet.microsoft.com/en-us/library/cc773354.aspx" target="_blank"&gt;Adsiedit.msc&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SCENARIO 2a&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;NETWORK SERVICE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with a Custom Host name, like &lt;font size="1"&gt;http://&lt;em&gt;www.mysite.com&lt;/em&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br&gt;SPNs will be required ONLY for the &lt;em&gt;IIS machine account&lt;/em&gt; in the following format: &lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="400" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="400"&gt;HTTP/&lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; for e.g. HTTP/&lt;em&gt;www.mysite.com&lt;/em&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;You can add an SPN using Setspn.exe like  &lt;p&gt;&amp;gt; Setspn -a &lt;strong&gt;http/&lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/strong&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;where &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; is the IIS machine account and &lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; is the custom host/host header name for the Web Site URL.&lt;/p&gt; &lt;p&gt;e.g. &amp;gt; Setspn -a http/www.mysite.com &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&amp;gt;&lt;/em&gt;&lt;br&gt;&lt;font size="1"&gt;*The command is NOT case sensitive&lt;/font&gt; &lt;/p&gt; &lt;p&gt;You can check the existing set of SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;  &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;SCENARIO 2b&lt;/strong&gt;&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="678" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;IIS 7.0 Web Site/Application&lt;/td&gt; &lt;td valign="top" width="469"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Integrated Windows authentication&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Application Pool Identity&lt;/td&gt; &lt;td valign="top" width="469"&gt;Custom account for e.g. Domain1\Username1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Kernel-Mode authentication&lt;/td&gt; &lt;td valign="top" width="469"&gt;Enabled (&amp;lt;attribute name="useKernelMode" type="bool" defaultValue="true" /&amp;gt; in the ApplicationHost.config file)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Site URL&lt;/td&gt; &lt;td valign="top" width="469"&gt;Accessed with a Custom host/Host header name, like &lt;font size="1"&gt;http://&lt;em&gt;www.mysite.com&lt;/em&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;br&gt;SPNs will be required ONLY for the IIS machine account and NOT for Domain1\Username1 account unlike in IIS 6.0.&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="400" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="400"&gt;HTTP/&lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; for e.g. HTTP/&lt;em&gt;www.mysite.com&lt;/em&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;You can add an SPN using Setspn.exe like  &lt;p&gt;&amp;gt; Setspn -a &lt;strong&gt;&lt;em&gt;http/&amp;lt;site-custom-name&amp;gt;&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;&amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;&lt;/strong&gt; where &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt; is the IIS machine account and &lt;em&gt;&amp;lt;site-custom-name&amp;gt;&lt;/em&gt; is the custom host/host header name for the Web Site URL.&lt;/p&gt; &lt;p&gt;e.g. &amp;gt; Setspn -a http/www.mysite.com &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&amp;gt;&lt;/em&gt;&lt;br&gt;&lt;font size="1"&gt;*The command is NOT case sensitive&lt;/font&gt;&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;You can check the existing set of SPNs for the machine account by running the following command:  &lt;p&gt;&amp;gt; Setspn.exe -L &amp;lt;&lt;em&gt;myIISserver-NetBIOS-name&lt;/em&gt;&amp;gt;  &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;Special case of running IIS 7.0 in a WEB FARM&lt;/strong&gt;&lt;br&gt;&lt;/font&gt;&lt;br&gt;If you are running IIS 7.0 server in a Web farm the KDC will not know in advance which individual server the request may go to and hence ticket decryption may fail. Hence in such a scenario instead of registering SPNs under a specific machine account use a domain account. I am not a SharePoint guy but based on what I have read on the Web this scenario is also applicable to a single SharePoint server configuration.&lt;br&gt;&lt;/p&gt; &lt;p&gt;There are two ways to go:&lt;/p&gt; &lt;p&gt;Either &lt;/p&gt; &lt;p&gt;Disable Kernel mode authentication and follow the general steps for Kerberos as in the previous IIS 6.0 version. Refer &lt;a href="http://support.microsoft.com/kb/871179" target="_blank"&gt;this&lt;/a&gt;.&amp;nbsp; &lt;p&gt;Or,  &lt;p&gt;[Recommended for Performance reasons]  &lt;p&gt;Let Kernel mode authentication be enabled and the Application pool's identity be used for Kerberos ticket decryption. The only thing you need to do here is:  &lt;p&gt;1. Run the Application pool under a common custom domain account.  &lt;p&gt;2. Add this attribute "useAppPoolCredentials" in the ApplicationHost.config file.  &lt;p&gt;&amp;lt;system.webServer&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;lt;security&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;authentication&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;windowsAuthentication enabled="true" useKernelMode="true" &lt;strong&gt;useAppPoolCredentials="true"&lt;/strong&gt; /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/authentication&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/security&amp;gt;&lt;br&gt;&amp;lt;/system.webServer&amp;gt;  &lt;p&gt;Remember there is no GUI setting for this. You need to modify the ApplicationHost.config file from  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&amp;lt;%SystemDrive%&amp;gt;/Windows/System32/inetsrv/config&lt;/u&gt;&lt;/strong&gt; folder on the IIS 7.0 machine.  &lt;p&gt;3. Add the SPNs in the form:  &lt;p&gt;&lt;em&gt;http/&amp;lt;virtualhost-name&amp;gt;&lt;/em&gt; and  &lt;p&gt;&lt;em&gt;http/&amp;lt;virtualhost-name.fully-qualified-name&amp;gt;&lt;/em&gt;&amp;nbsp; for the Application Pool Identity.  &lt;p&gt;Ensure that we don't have such an entry for SPNs for any other account including IIS server machine account.  &lt;p&gt;***If we have the same SPN mapped to multiple accounts (be it a machine or an user account) it leads to Duplicate SPNs and will break Kerberos.  &lt;p&gt;Hope this helps!  &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9252291" width="1" height="1"&gt;</description><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/Kerberos/default.aspx">Kerberos</category><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/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category></item><item><title>Troubleshooting TS Gateway connectivity on Windows 2008, IIS 7.0</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/08/30/troubleshooting-ts-gateway-connectivity-on-windows-2008-iis-7-0.aspx</link><pubDate>Sat, 30 Aug 2008 07:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8907590</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/8907590.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=8907590</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=8907590</wfw:comment><description>&lt;P&gt;Here is something which is not my domain but had to learn the hard way. I recently encountered an issue while enabling Terminal Services Gateway (TSG) on Windows 2008 server. TSG is coupled with IIS 7.0 hosted on Windows 2k8 server and that's how I came into picture. TSG in simple terms is a feature using which one can connect remotely to an internal network over secure HTTPS port 443 from the Internet. Earlier Remote Desktop Protocol (RDP) connections used TCP port 3389. In many corporate environment this port may be blocked by the firewall. However now with TSG connecting on port 443 (common SSL port for http traffic) user should not get into the common issues of port being blocked. In my case we had the TSG installed as one of the roles on the server. The setup was fine.&lt;BR&gt;The only concern was that we already were using the Default Web site for some application. It can also happen otherwise, you have the TSG setup on an IIS 7 web site and if you go ahead and install let's say Exchange on top of it under the same site it may break the TSG functionality. &lt;/P&gt;
&lt;P&gt;When you install TSG, it creates two virtual directories called Rpc and RpcWithCert under the web site as shown below. 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=147 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_1.png" width=152 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_1.png"&gt;&lt;/A&gt; 
&lt;P&gt;Under the hood it appears a call is made for 
&lt;P&gt;http://&amp;lt;server-name&amp;gt;:443/rpc/rpcproxy.dll?localhost:3388 when you try to connect through TSG. So yes IIS is very much involved here. 
&lt;P&gt;Now what can you do to fix this, perhaps you can install your web application (say Exchange) on some other web site and a different SSL port like 444 and have TSG site listening on port 443. Or else just the opposite. 
&lt;P&gt;In my case we went with the 2nd option since we didn't want Exchange to be reinstalled again.&lt;BR&gt;But even if you use either of the above options it may not go that smoothly as it looks to be. 
&lt;P&gt;You may see the error as shown below when you try to use terminal service through TSG. 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_12.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_12.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=401 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_5.png" width=419 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_5.png"&gt;&lt;/A&gt; Click on OK...&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_8.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=123 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_3.png" width=560 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;If you are seeing something like this, as a workaround create a new web site and copy the settings for the Virtual directories &lt;STRONG&gt;/Rpc&lt;/STRONG&gt; and &lt;STRONG&gt;/RpcwithCert&lt;/STRONG&gt; from the previous site to the the new web site. You can do this easily by copying the configuration in the applicationHost.config file.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Here are the steps:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;1. Copy the following configuration (in the ApplicationHost.config file from C:\&amp;lt;Windows&amp;gt;\System32\inetsrv\config) from the previous site to the new site to add the virtual directories for your new web site.&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: 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: #006080"&gt;&amp;lt;&lt;/SPAN&gt;site name="&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;new-web-site&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;" id=...&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
...
&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;application path="/Rpc" applicationPool="SomeAppPool"&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
       &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;virtualDirectory path="/" physicalPath="C:\Windows\System32\RpcProxy" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/application&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;application path="/RpcWithCert" applicationPool="SomeAppPool"&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;virtualDirectory path="/" physicalPath="C:\Windows\System32\RpcProxy" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/application&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt; 
...
&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/site&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;So this will create two virtual directories in your new web site called &lt;STRONG&gt;Rpc&lt;/STRONG&gt; and &lt;STRONG&gt;RpcWithCert&lt;/STRONG&gt;. 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_14.png" mce_href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_14.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=67 alt=image src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_6.png" width=138 border=0 mce_src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/ce79cb5c9d9e_1A02/image_thumb_6.png"&gt;&lt;/A&gt; 
&lt;P&gt;Add an SSL binding for the new Web site on port 443 as well. Ensure no other site is listening on port 443. 
&lt;P&gt;2. Copy the following for the previous web site in the ApplicationHost.config file to the new web site. 
&lt;P&gt;This is the section contained in the Location tag for the Virtual directories &lt;STRONG&gt;/Rpc&lt;/STRONG&gt; and &lt;STRONG&gt;/RpcWithCert&lt;/STRONG&gt;. You need to copy this section from the location tag for the &amp;lt;previous-web-site&amp;gt; and add it to the location tag for the &amp;lt;new-web-site&amp;gt;.&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;&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;location path="&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;previous-web-site&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;/Rpc"&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;system&lt;SPAN style="COLOR: #cc6633"&gt;.webServer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;directoryBrowse enabled="false" showFlags="Date, Time, Size, Extension" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;handlers accessPolicy="Execute"&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;add name="RPCPROXY" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\system32\RpcProxy\RpcProxy&lt;SPAN style="COLOR: #cc6633"&gt;.dll&lt;/SPAN&gt;" requireAccess="Execute" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/handlers&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;serverRuntime uploadReadAheadSize="0" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;defaultDocument enabled="true" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;modules&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;add name="PasswordExpiryModule" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/modules&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;security&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;requestFiltering&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;requestLimits maxAllowedContentLength="2147483648" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/requestFiltering&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;authentication&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;anonymousAuthentication enabled="false" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;basicAuthentication enabled="false" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;windowsAuthentication enabled="true" useKernelMode="false" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/authentication&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;access sslFlags="Ssl, Ssl128" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/security&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;httpErrors&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;remove statusCode="401" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;error statusCode="401" path="C:\Windows\system32\RpcProxy\Error401&lt;SPAN style="COLOR: #cc6633"&gt;.txt&lt;/SPAN&gt;" responseMode="File" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/httpErrors&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/system&lt;SPAN style="COLOR: #cc6633"&gt;.webServer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/location&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&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;&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;location path="&lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;previous-web-site&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;/RpcWithCert"&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;system&lt;SPAN style="COLOR: #cc6633"&gt;.webServer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;directoryBrowse enabled="false" showFlags="Date, Time, Size, Extension" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;handlers accessPolicy="Execute"&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;add name="RPCPROXY" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\system32\RpcProxy\RpcProxy&lt;SPAN style="COLOR: #cc6633"&gt;.dll&lt;/SPAN&gt;" requireAccess="Execute" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/handlers&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;defaultDocument enabled="true" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;security&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;authentication&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;anonymousAuthentication enabled="false" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;basicAuthentication enabled="false" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;clientCertificateMappingAuthentication enabled="true" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;digestAuthentication enabled="false" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;windowsAuthentication enabled="false" useKernelMode="false" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;iisClientCertificateMappingAuthentication enabled="true" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/authentication&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;access sslFlags="Ssl, SslNegotiateCert, SslRequireCert, Ssl128" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;requestFiltering&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;requestLimits maxAllowedContentLength="2147483648" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/requestFiltering&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/security&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;serverRuntime uploadReadAheadSize="0" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;modules&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;add name="PasswordExpiryModule" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/modules&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;httpErrors&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;remove statusCode="401" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
                &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;error statusCode="401" path="C:\Windows\system32\RpcProxy\Error401&lt;SPAN style="COLOR: #cc6633"&gt;.txt&lt;/SPAN&gt;" responseMode="File" /&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/httpErrors&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/system&lt;SPAN style="COLOR: #cc6633"&gt;.webServer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #006080"&gt;&amp;lt;&lt;/SPAN&gt;/location&lt;SPAN style="COLOR: #006080"&gt;&amp;gt;&lt;/SPAN&gt; &lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR&gt;3. Ensure that we replace &lt;EM&gt;&lt;STRONG&gt;&amp;lt;previous-web-site&amp;gt;&lt;/STRONG&gt;&lt;/EM&gt; with the &lt;EM&gt;&lt;STRONG&gt;&amp;lt;new-web-site&amp;gt;&lt;/STRONG&gt;&lt;/EM&gt; in the following tags above:&lt;/P&gt;
&lt;P&gt;&amp;lt;location path="&lt;STRONG&gt;&amp;lt;previous-web-site&amp;gt;&lt;/STRONG&gt;/RpcWithCert"&amp;gt; &lt;STRONG&gt;-----&amp;gt;&lt;/STRONG&gt; &amp;lt;location path="&lt;STRONG&gt;&amp;lt;new-web-site&amp;gt;&lt;/STRONG&gt;/RpcWithCert"&amp;gt; &lt;/P&gt;&amp;lt;location path="&lt;STRONG&gt;&amp;lt;previous-web-site&amp;gt;&lt;/STRONG&gt;/Rpc"&amp;gt;&amp;nbsp; &lt;STRONG&gt;-----&amp;gt;&lt;/STRONG&gt; &amp;lt;location path="&lt;STRONG&gt;&amp;lt;new-web-site&amp;gt;&lt;/STRONG&gt;/Rpc"&amp;gt;&lt;BR&gt;
&lt;P&gt;4. Run iisreset from the cmd prompt. Or it may also work with just restarting W3SVC service (net stop w3svc, net start w3svc).&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Go ahead and test RDP over TSG from the client. If it still doesn't work you may have to try the 5th step as below.&lt;/P&gt;
&lt;P&gt;5. Add the following registry entry. Run this from the cmd prompt:&lt;BR&gt;&amp;gt; reg add HKLM\Software\Microsoft\RPC\RpcProxy /v Website /t REG_SZ /d&amp;nbsp; &lt;STRONG&gt;&amp;lt;new-web-site&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;One last thing, ensure that the certificate issued to the TS server gateway is trusted on the client from where we are doing a terminal login. &lt;/P&gt;
&lt;P&gt;Happy troubleshooting! 
&lt;P&gt;Cheers &lt;IMG alt="Martini Glass" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/martini.gif" mce_src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/martini.gif"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8907590" 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/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/TS+Gateway/default.aspx">TS Gateway</category></item><item><title>Some tips if your IIS 6.0 World Wide Web Service (WWW) ever goes down...</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/07/25/some-tips-if-your-iis-6-0-world-wide-web-service-www-ever-goes-down.aspx</link><pubDate>Fri, 25 Jul 2008 18:09:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8772330</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/8772330.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=8772330</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=8772330</wfw:comment><description>&lt;p&gt;Well, every time I try writing some thing different than IIS and for some reason I come back to it :-)&lt;/p&gt; &lt;p&gt;Here is a quick troubleshooting tip for a scenario where World Wide Web service on my test IIS 6.0 box went down for no apparent reason. Here is what I started seeing when we tried to start all IIS related services. IIS ADMIN service came up fine but I wasn't lucky enough with WWW &lt;img alt="Sad" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/sad_smile.gif"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="119" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb.png" width="640" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;From the Services console I got this error message when tried to start WWW service:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="134" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_1.png" width="467" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Now this was weird, I remember everything was fine just few minutes ago. I wondered how we could resolve the issue.&lt;/p&gt; &lt;p&gt;Event log showed the following:&lt;/p&gt; &lt;p&gt;&lt;em&gt;Event Type:&amp;nbsp;&amp;nbsp;&amp;nbsp; Error&lt;br&gt;Event Source:&amp;nbsp;&amp;nbsp;&amp;nbsp; Service Control Manager&lt;br&gt;Event Category:&amp;nbsp;&amp;nbsp;&amp;nbsp; None&lt;br&gt;Event ID:&amp;nbsp;&amp;nbsp;&amp;nbsp; 7023&lt;br&gt;Date:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7/25/2008&lt;br&gt;Time:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6:59:50 AM&lt;br&gt;User:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&lt;br&gt;Computer:&amp;nbsp;&amp;nbsp;&amp;nbsp; SAURABSI-SEC&lt;br&gt;Description:&lt;br&gt;The World Wide Web Publishing Service service terminated with the following error: &lt;br&gt;Access is denied.&lt;/em&gt;  &lt;p&gt;Now, this started making some sense. It was quite apparent that there was a permission issue. But then I was a local admin on the box and I had not changed any file permission recently, at least not in the last few minutes for sure.  &lt;p&gt;I tried running Process Monitor from &lt;a href="http://www.sysinternals.com"&gt;www.sysinternals.com&lt;/a&gt;. It is a handy tool to troubleshoot permission issues. Unfortunately I couldn't see any ACCESS DENIED anywhere in the log collected via this tool. Now if there was no access denied anywhere what else could have led to such an error message!!!  &lt;p&gt;I ran &lt;a href="http://technet.microsoft.com/hi-in/sysinternals/bb896647(en-us).aspx" target="_blank"&gt;DebugView&lt;/a&gt; while reproducing the WWW startup issue.  &lt;p&gt;It showed the following:  &lt;p&gt;&lt;/p&gt; &lt;div style="overflow: scroll"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_8.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="501" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_3.png" width="1124" border="0"&gt;&lt;/a&gt; &lt;/div&gt; &lt;p&gt;I noticed this in the above log:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="17" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_4.png" width="358" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now it was clear that there were no issues as far as accessing this metabase file was concerned. Had there been a permission issue to access this file it should have been captured by the Process Monitor utility. Also since IISADMIN was up and running it was sure that metabase was fine and was accessible. I wondered if there was something within this file, maybe some key/property etc. which was giving the problem.  &lt;p&gt;I went ahead with Metabase Explorer (also called as MBExplorer, part of &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&amp;amp;DisplayLang=en" target="_blank"&gt;IIS 6.0 Resource kit&lt;/a&gt;) and tried to read through the various hierarchy in the metabase. The moment I tried to launch MBExplorer it gave the following error:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="160" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_5.png" width="217" border="0"&gt;&lt;/a&gt;  &lt;p&gt;This was getting interesting now :-). I clicked on Yes and launched the utility anyway.  &lt;p&gt;While scanning through the various structures within MBExplorer I got another similar alert when I reached the following location:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_18.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="618" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_8.png" width="557" border="0"&gt;&lt;/a&gt;  &lt;p&gt;I knew now that this subkey was having the permission issue for sure. However I could not even import this setting from any other machine since I could not even rename the key !!  &lt;p&gt;Looked like even administrator account had no permission on this key. It could not even be inherited from its parent level using MBExplorer.  &lt;p&gt;So, after some thought this is what I did. Stopped IISADMIN service and opened metabase.xml file in a notepad.  &lt;p&gt;Found the section which described the Filters subkey properties as shown below:  &lt;p&gt;&lt;/p&gt; &lt;div style="overflow: scroll"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_20.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="183" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_9.png" width="854" border="0"&gt;&lt;/a&gt;&lt;/div&gt; &lt;p&gt;The only way to change the ACL on this key was to remove the AdminACL attribute such that it would inherit the same from its parent level, i.e. W3SVC level in the above MBExplorer window. I deleted the above AdminACL attribute completely, saved the file and gave a restart with my fingers crossed ;-). I had a backup.&lt;/p&gt; &lt;p&gt;Hurray!!! this is what I got finally.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_22.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="73" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_10.png" width="314" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_24.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="105" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_11.png" width="572" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Later on, found that while playing with permissions for compression filter, accidentally the ACL permissions for Administrators and IIS_WPG was removed, and I was a member of both these two groups :-(&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_26.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="225" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/bcdd76ca707d_110D0/image_thumb_12.png" width="366" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Finally all that ends well is well, I am a happy man now &lt;img alt="Tongue out" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/tongue_smile.gif"&gt;.&lt;/p&gt; &lt;p&gt;Hope this helps someone stuck in a similar situation...&lt;/p&gt; &lt;p&gt;Cheers&lt;img alt="Martini Glass" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/martini.gif"&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8772330" 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/Setup/default.aspx">Setup</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/service+startup/default.aspx">service startup</category></item><item><title>Enabling Active Directory Isolation mode for FTP to work for trusted domain users</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/03/13/enabling-active-directory-isolation-mode-for-ftp-to-work-for-trusted-domain-users.aspx</link><pubDate>Thu, 13 Mar 2008 04:34:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8176957</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/8176957.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=8176957</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=8176957</wfw:comment><description>&lt;p&gt;Let's consider a scenario wherein we have an FTP site hosted on an IIS Server and we are trying to setup the site to work in Active Directory (AD) Isolation mode. Now things should work just fine if we have the setup done properly. I have talked about general setup and common issues with FTP sites &lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/10/04/troubleshooting-ftp-related-issues-on-iis-6-0.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;This should ideally work fine for the domain users which are in same domain as IIS (Let's say Domain 1). We should know AD isolation mode is supported for domain users only and not local users. Now consider a scenario wherein you want to have FTP working for users from a different domain (Let's say Domain 2).This is not as simple as just running the iisftp.vbs script on the IIS server to set FTP Root and FTP directory properties for domain2 users.&lt;/p&gt; &lt;p&gt;When you try to set this up you will see something like this:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;C:\WINDOWS\system32&amp;gt;cscript iisftp.vbs /setadprop test1 ftproot "C:\inetpub"&lt;br&gt;Microsoft (R) Windows Script Host Version 5.6&lt;br&gt;Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.  &lt;p&gt;User test1 was not found in Active Directory. &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;[Here assuming test1 to be a domain 2 account and we are running this script on the IIS server which is in Domain 1]&lt;/p&gt; &lt;p&gt;This is expected since test1 is not a domain 1 account, and hence iisftp.vbs won't be able to find it in the Active Directory. By default, iisftp.vbs will look into the domain where it is running and since we are running this on IIS's domain (i.e. domain 1) it will fail. this is its limitation.&lt;/p&gt; &lt;p&gt;To ensure we can set the FTP root and FTP directories for different domain users (to which IIS doesn't belong), ensure this domain has a trust relationship with IIS's domain first.&lt;/p&gt; &lt;p&gt;Also to set the above properties we need to manually run iisftp.vbs on a machine which belongs to domain 2. You may see this error when you run the script:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;Could not create an instance of the IIsScriptHelper object.&lt;br&gt;Please register the Microsoft.IIsScriptHelper component.&lt;/strong&gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;We need to ensure we have these two files IIsScHlp.wsc and IIsFtp.vbs copied locally from a working machine (where iisftp.vbs works for e.g. the IIS server). So if IIS is not installed on a machine in domain 2 you can just copy these two files from the IIS server to the domain 2 machine and register the script IISScHlp. &lt;/p&gt; &lt;p&gt;C:\FTP&amp;gt;regsvr32 iisschlp.wsc&lt;/p&gt; &lt;p&gt;You will get an alert like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/5b1cf6f75086_52C2/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="124" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/5b1cf6f75086_52C2/image_thumb.png" width="401" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once done you can run the iisftp script in there.&lt;/p&gt; &lt;p&gt;Now once we have the iisftp.vbs running fine on a domain 2 machine, using admin privilege you can set the FTP root and FTP directory for the domain 2 users. iisftp.vbs does the changes to the account in AD and has nothing to do with IIS metabase settings. &lt;/p&gt; &lt;p&gt;So after this you can follow the /setadprop and /getadprop to set/get the FTP root/directory settings for domain 2 users.&lt;/p&gt; &lt;p&gt;Remember that in this case the FTP root should be a network share like \\server1\... etc.&lt;/p&gt; &lt;p&gt;Reason being that FTP service which is running on IIS server in domain 1 should be able to access this location (or share). If we give a local path on a machine in domain 2, IIS FTP service has no way to access it since it is running on IIS server in domain 1. &lt;/p&gt; &lt;p&gt;Once done if you access the FTP site from any of the machine, let's say from anywhere on domain1 or domain 2 you should be able to access the site with your own domain credentials (could be a domain1 or domain2 account) provided there is an FTP root and FTP directory for your account set in either domain 1 or domain 2 as mentioned above.&lt;/p&gt; &lt;p&gt;Happy FTP' ing ;-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8176957" 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/Setup/default.aspx">Setup</category></item><item><title>HTTP to HTTPS (SSL) Web Request Redirection</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/01/03/http-to-https-ssl-web-request-redirection.aspx</link><pubDate>Fri, 04 Jan 2008 00:47:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6972331</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/6972331.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=6972331</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=6972331</wfw:comment><description>&lt;p&gt;We often get requests from our customers asking how they can seamlessly redirect web requests from HTTP to HTTPS, i.e. how they can redirect a non-SSL request to an SSL based request. Recently a colleague of mine got a similar issue and we decided to use some existing scripts that we had in our database. Unfortunately none could meet the requirement.&lt;/p&gt; &lt;p&gt;Basically the existing scripts redirected an HTTP request to another URL and that URL was not the original request user had asked for. It took us to let's say the homepage of the site and from there one again has to click on specific links to reach the desired page. So this will be a problem for users who have book-marked their desired web page.&lt;/p&gt; &lt;p&gt;Here are the steps you can try for your website such that all HTTP requests get translated to HTTPS requests and have the original URL intact.&lt;/p&gt; &lt;p&gt;Here are two sample codes which one can try. Both of them should *hopefully* work. First one uses VBScript in an ASP page and second one uses Javascript in an HTML page.&lt;/p&gt; &lt;p&gt;a).&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;redirectSSL.asp&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;div&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;&amp;lt;%@ Language=VBScript %&amp;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;lt;% &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;strQueryString = Request.QueryString&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;sslPort = null&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;PlainURL = Right(strQueryString, len(strQueryString) - 4)&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;FindLastCOlon = InStrRev(PlainURL, &lt;span style="color: #006080"&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;FirstPart = Mid(PlainURL, 1, FindLastColon - 1)&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;LastPart = Mid(PlainURL, FindLastColon)&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;LastPart = (Mid(LastPart, InStr(LastPart, &lt;span style="color: #006080"&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: #008000"&gt;'If the SSL Port is not the default 443, you need to uncomment the line below, by default SSL port is 443.&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;'sslPort = ":449"&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; (sslPort = null) &lt;span style="color: #0000ff"&gt;then&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;    url= FirstPart &amp;amp; LastPart&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;    url = FirstPart &amp;amp; sslPort &amp;amp; LastPart&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;end&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&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;strSecure = Replace(url, &lt;span style="color: #006080"&gt;"http:"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"https:"&lt;/span&gt;, 1, 1)&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.Redirect strSecure&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;gt; &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Steps:&lt;/p&gt;
&lt;p&gt;-- Copy the above code and put in a file redirectSSL.asp under your Website root directory for which you want redirection to work.&lt;/p&gt;
&lt;p&gt;-- Force SSL on the web site. To do that follow the steps mentioned below:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Go to --&amp;gt; &amp;lt;Your_Web_Site&amp;gt; -&amp;gt; Properties -&amp;gt; Directory Security -&amp;gt; Edit (Secure Communications) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Select Require secure channel (SSL).&lt;/p&gt;
&lt;p&gt;-- Uncheck "Require secure channel (SSL)" option for the redirectSSL.asp page. To achieve that:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Go to --&amp;gt; &amp;lt;Your_Web_Site&amp;gt; -&amp;gt; redirectSSL.asp -&amp;gt; Properties -&amp;gt; File Security -&amp;gt; Edit (Secure Communications) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Uncheck Require secure channel (SSL).&lt;/p&gt;
&lt;p&gt;So now we are forcing SSL to be used for all of the website contents except the redirectSSL.asp page which can be accessed over non-SSL (HTTP).&lt;/p&gt;
&lt;p&gt;-- In the IIS manager -&amp;gt; &amp;lt;Your_Web_Site&amp;gt; -&amp;gt; Properties -&amp;gt; Custom Errors, modify the entry for 403;4 to look like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b4042bfb6c64_11B6E/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="465" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b4042bfb6c64_11B6E/image_thumb.png" width="472" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now if you try to browse to some URL, let's say &lt;font color="#ff8040"&gt;http://www.abc.com/asp/test/ssl/iistsart.htm&lt;/font&gt;, you will be redirected to &lt;font color="#ff8040"&gt;http&lt;strong&gt;&lt;u&gt;s&lt;/u&gt;&lt;/strong&gt;://www.abc.com/asp/test/ssl/iistsart.htm, &lt;/font&gt;&lt;font color="#ffffff"&gt;without you requiring to modify HTTP to HTTPS.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;If your SSL port is not the default port 443 then you need to un-comment a line in the code as mentioned in there and it will redirect the request to the appropriate URL with corrected SSL port embedded in it.&lt;/p&gt;
&lt;p&gt;b).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;redirectSSL.html&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div&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;&amp;lt;html&amp;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;lt;head&amp;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;&amp;lt;script language=&lt;span style="color: #006080"&gt;"javascript"&lt;/span&gt;&amp;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;var&lt;/span&gt; currentURL=location.href.substring(0,5)&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;(currentURL.toLowerCase()!=&lt;span style="color: #006080"&gt;"https"&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;currentURL = location.href.substring(4,location.href.lastIndexOf(&lt;span style="color: #006080"&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;var&lt;/span&gt; portStartPos = currentURL.lastIndexOf(&lt;span style="color: #006080"&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: #0000ff"&gt;var&lt;/span&gt; sslPort = &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;if&lt;/span&gt;(portStartPos!=0)&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;var&lt;/span&gt; relativeURL = currentURL.substring(portStartPos)&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;var&lt;/span&gt; postPortURL = relativeURL.substring(relativeURL.indexOf(&lt;span style="color: #006080"&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;var&lt;/span&gt; URL = currentURL.substring(0,portStartPos)&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 are running your SSL site on a non default port other than 443 then uncomment the next line and add the right Port number.&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;//sslPort = ":447"&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;if&lt;/span&gt;(sslPort == &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;    currentURL = URL + postPortURL&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;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: white; border-bottom-style: none"&gt;    currentURL = URL + sslPort + postPortURL&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;var&lt;/span&gt; targetURL = &lt;span style="color: #006080"&gt;"https"&lt;/span&gt; + currentURL&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;window.location = targetURL&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;lt;/script&amp;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;&amp;lt;/head&amp;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;lt;/html&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Steps:&lt;/p&gt;
&lt;p&gt;-- Copy the above code and put in a file redirectSSL.html under your Website root directory for which you want redirection to work.&lt;/p&gt;
&lt;p&gt;-- Force SSL on the web site. To do that follow the steps mentioned below:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Go to --&amp;gt; &amp;lt;Your_Web_Site&amp;gt; -&amp;gt; Properties -&amp;gt; Directory Security -&amp;gt; Edit (Secure Communications) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Select Require secure channel (SSL).&lt;/p&gt;
&lt;p&gt;So now we are forcing SSL to be used for all of the Website contents.&lt;/p&gt;
&lt;p&gt;-- In the IIS manager -&amp;gt; &amp;lt;Your_Website&amp;gt; -&amp;gt; Properties -&amp;gt; custom Errors, modify the entry for 403;4 to look like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b4042bfb6c64_11B6E/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="465" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b4042bfb6c64_11B6E/image_thumb_1.png" width="472" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;You need not follow the step below since we are using File Type for custom error page and not a URL as shown above in the picture. If you select URL as Type above then you will need to follow the step below.&lt;/p&gt;
&lt;p&gt;"&lt;font color="#ff8040"&gt;-- Uncheck "Require secure channel (SSL)" option for the redirectSSL.html page. To achieve that:&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Go to --&amp;gt; &amp;lt;Your_Web_Site&amp;gt; -&amp;gt; redirectSSL.asp -&amp;gt; Properties -&amp;gt; File Security -&amp;gt; Edit (Secure Communications) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Uncheck Require secure channel (SSL).&lt;/font&gt;"&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is all you need and you should see your URL changing automagically from HTTP to HTTPS (SSL). &lt;/p&gt;
&lt;p&gt;Hope this helps...&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6972331" 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/SSL/default.aspx">SSL</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/Setup/default.aspx">Setup</category></item><item><title>Wildcard SSL certificate in IIS 6.0, Windows 2003 Sp1 and above</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/11/17/wildcard-ssl-certificate-in-iis-6-0-windows-2003-sp1-and-above.aspx</link><pubDate>Sat, 17 Nov 2007 07:12:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6327316</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>77</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/6327316.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=6327316</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=6327316</wfw:comment><description>Here I will be talking about configuring SSL wildcard certificates in IIS 6.0 on Win2k3 SP1 and above. You may have a scenario wherein you want to have the same certificate installed for multiple Websites. Now in a normal scenarios this is not possible....(&lt;a href="http://blogs.msdn.com/saurabh_singh/archive/2007/11/17/wildcard-ssl-certificate-in-iis-6-0-windows-2003-sp1-and-above.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6327316" 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/SSL/default.aspx">SSL</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Setup/default.aspx">Setup</category></item><item><title>How to setup IIS and AD for Client certificate authentication</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/04/14/how-to-setup-iis-and-ad-for-client-certificate-setup-and-authentication.aspx</link><pubDate>Sat, 14 Apr 2007 14:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2130289</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/2130289.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=2130289</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=2130289</wfw:comment><description>&lt;p&gt;Hi All,  &lt;p&gt;This post talks about how Client certificates are configured on websites. I have seen a lot of incidents where people get into issues with client certificate in particular, although server (website) certificates can give a scare at times.  &lt;p&gt;Here I will be walking you through the steps of configuring client certificates in your Windows 2003 environment (although there is not much of a difference in Windows 2000).  &lt;p&gt;&lt;b&gt;&lt;u&gt;Environment&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;Windows 2003 (Web server) IIS6.0  &lt;p&gt;Windows 2000/XP/2003 (Client)  &lt;p&gt;Windows 2003 (Microsoft Certificate server)  &lt;p&gt;&lt;b&gt;&lt;u&gt;Walkthrough&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;1. To enable SSL transaction between the server and the client, you need to have a server certificate installed on IIS website. Websites can get the server certificate from a trusted root Certificate Authority (CA). We will be focusing on the steps for acquiring client certificates and setting them in IIS for user authentication.  &lt;p&gt;2. Here I will show the screenshot of the steps that one needs to follow with brief explanation of the steps.  &lt;p&gt;Client Workstation:&lt;b&gt; WIN2kIIS-VPC&lt;/b&gt;  &lt;p&gt;CA server:&lt;b&gt; WIN2K3DC&lt;/b&gt;  &lt;p&gt;IIA Web Server:&lt;b&gt; WIN2K3OWA&lt;/b&gt;  &lt;p&gt;DC:&lt;b&gt; WIN2K3DC&lt;/b&gt;  &lt;p&gt;Domain:&lt;b&gt; Anjenya.local&lt;/b&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt; &lt;p&gt;&lt;b&gt;&lt;i&gt;Requesting a client certificate from a Trusted root Certificate Authority (CA): &lt;/i&gt;&lt;/b&gt; &lt;p&gt;Access the CA Website from your client machine as &lt;a href="http://win2k3dc/certsrv" mce_href="http://Win2k3dc/certsrv"&gt;http://Win2k3dc/certsrv&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;There are two ways of obtaining client certificate.&lt;/p&gt; &lt;p&gt;Click on the link: Request a Certificate.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_1.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Click on “Select a certificate type: User certificate”.  &lt;p&gt;You can also obtain the certificate by clicking on “advanced certificate request” to add more specific details about the client certificate.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_2.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click on &lt;b&gt;&lt;i&gt;More Options &amp;gt;&amp;gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_8.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_3.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Go ahead and hit &lt;b&gt;&lt;i&gt;Submit &amp;gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_10.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/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_4.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click on &lt;b&gt;&lt;i&gt;“Yes”&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="438" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_5.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Go ahead and click on the link to install the certificate. You might get the certificate directly as above or through email etc when in case of a 3&lt;sup&gt;rd&lt;/sup&gt; party after verification.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_14.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="400" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_6.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click on &lt;b&gt;&lt;i&gt;“Yes”&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_16.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="436" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_7.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Now the User certificate is successfully installed on your client machine.&lt;/p&gt; &lt;p&gt;You can check the certificate in two ways:  &lt;p&gt;1. Goto &lt;b&gt;&lt;i&gt;IE-&amp;gt;Tools-&amp;gt;Internet Options-&amp;gt;Content-&amp;gt;Certificates&lt;/i&gt;&lt;/b&gt;.  &lt;p&gt;You should see the certificate there under Personal store, which was installed on your client machine.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_18.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="437" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_8.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;1. Or else you can open the Certificate snap-in through &lt;b&gt;&lt;i&gt;Start-&amp;gt;Run-&amp;gt;Mmc-&amp;gt;Console-&amp;gt;Add/Remove Snap-in-&amp;gt;Add… -&amp;gt; Certificates&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_20.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="452" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_9.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Go ahead and add the certificates snap-in.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_22.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="452" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_10.png" width="628" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Double click on the certificate and you should see the details about it:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_24.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="487" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_11.png" width="419" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Enhanced Key usage will show you the purpose of this certificate.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_26.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="487" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_12.png" width="419" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The above picture shows that this certificate is meant for Client Authentication.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_28.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="487" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_13.png" width="419" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;So here we finish the process of acquiring the client certificate.&lt;/p&gt; &lt;p&gt;Now the next step is to map the client certificate in IIS manager, depending upon one’s requirements. It can be one of the following:  &lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Option to accept the client certificate from the user by the IIS website (with no mapping enabled).  &lt;li&gt;Option to have 1-to-1 mapping for client certificate.  &lt;li&gt;Option to have Many-to-one mapping for client certificate.  &lt;li&gt;Option to have Active Directory Mapping for client certificate.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;1-to-1 and Many-to-1 mapping are simple to setup.  &lt;p&gt;Here I will walk you through the process of setting up the above configuration for 1-to-1 mapping and Active directory mapping.  &lt;p&gt;Let’s say that you have a website in IIS for which you want to enable client certificate.  &lt;p&gt;You need to go to &lt;b&gt;&lt;i&gt;IIS Manager-&amp;gt;Default Website-&amp;gt; &lt;/i&gt;&lt;/b&gt;&lt;i&gt;right click and go to&lt;b&gt; Properties-&amp;gt;Directory Security-&amp;gt;&lt;/b&gt;Under&lt;b&gt; Secure Communications &lt;/b&gt;section&lt;b&gt;, click on Edit&lt;/b&gt;&lt;/i&gt;.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_30.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="432" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_14.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_32.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="469" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_15.png" width="479" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Here in the picture above, you have three options for Client Certificates:  &lt;ul&gt; &lt;li&gt;Ignore client certificates: IIS will ignore client certificate when a request reaches IIS website, even though web request has the certificate in it.  &lt;li&gt;Accept Client certificates: IIS website will accept any client certificate from the user, if it is along with the web request.  &lt;li&gt;Require Client certificates: IIS website will check for client certificate along with web request. If no client certificate is in the web request, users shall see 403.7 – Client certificate required, as the error message in the web page response.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Now in the next section in the same picture above, if you want your website to be configured such that a client certificate is mapped to a user account, you can check on “Enable client certificate mapping”. What it means is that request will be executed in the context of an account.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_34.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="523" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_16.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now, when you enable 1-to -1 Mapping, an individual client certificate will be mapped to a specific Windows account. So in case you don’t want any of the IIS authentication methods to be used, like Anonymous, Basic, Digest or Windows Integrated authentication, you can rely upon client certificate authentication based on 1-to -1 or Many-to-1 mappings.  &lt;p&gt;We will first go ahead with 1-to-1 mapping:  &lt;p&gt;Click on “&lt;b&gt;Add…&lt;/b&gt;” in the Account Mappings window shown above.  &lt;p&gt;Now before you map a client certificate with a windows account, you need to have the corresponding client certificate on the server.  &lt;p&gt;Export the client certificate from the CA or the client machine (where you have the certificate installed) as follows:  &lt;p&gt;&lt;b&gt;&lt;u&gt;1) From Client machine&lt;/u&gt;&lt;/b&gt;: Open Certificate snap-in as earlier and go to &lt;b&gt;&lt;i&gt;Certificates – Current User &lt;/i&gt;-&amp;gt; &lt;i&gt;Personal -&amp;gt; Certificates&lt;/i&gt;&lt;/b&gt;.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_36.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="528" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_17.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Double click on the selected certificate and Click on &lt;b&gt;&lt;i&gt;Details&lt;/i&gt;&lt;/b&gt; and go to “&lt;b&gt;&lt;i&gt;Copy to File…&lt;/i&gt;&lt;/b&gt;”.  &lt;p&gt;Follow the Export wizard.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_38.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="607" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_18.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_40.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="607" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_19.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;You can either Export the private key or not export it. You should know the meaning of exporting the private key.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_42.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="607" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_20.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Go ahead and save the client certificate somewhere on your workstation (client).  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_44.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_21.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;b&gt;2) &lt;/b&gt;&lt;b&gt;&lt;u&gt;From CA:&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;Go to the Certificate Authority Snap-in and check the following location:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_46.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="338" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_22.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_48.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="485" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_23.png" width="418" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Double click to display the certificate. Click on “&lt;b&gt;Copy to File...&lt;/b&gt;” and follow the Certificate Export Wizard, and save the file to the server as shown below:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_50.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="403" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_24.png" width="515" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now copy the saved certificate from any of the above location to the IIS server, where we need to map it a windows account.  &lt;p&gt;Back to IIS manager console for certificate mapping:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_52.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="443" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_25.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now map a specific windows account with this certificate as shown below:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_54.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="422" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_26.png" width="628" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_56.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="464" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_27.png" width="645" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Once the 1 to 1 mapping is set in place go ahead and try browsing the site.  &lt;p&gt;Here I have used an ASP script to render the server variables pertaining to the web request.  &lt;p&gt;This script will display the logged on user name and the authentication type used along with some other information.  &lt;p&gt;Also when you want to use Client certificate authentication you can clear all other authentication options in the IIS manager Directory Security setting as show below:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_58.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="464" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_28.png" width="645" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Here you won’t get 401.2 server configuration error because we are using some sort of authentication mechanism (client certificate mapping) to authenticate the user. Had we been not using client certificate mapping we would have got 401.2 if we try to access the site with no authentication method selected in IIS manager.  &lt;p&gt;Had there not been Client cert mapping and we had tried to browse to the web page with all the options cleared as shown above, you would have got error 401.2.  &lt;p&gt;Here is the sample logoninfo.asp page which displays server variables. Try accessing this page.  &lt;p&gt;&amp;lt;%  &lt;p&gt;response.write ("LOGON_USER: ")  &lt;p&gt;response.write (request.servervariables("LOGON_USER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("AUTH_USER: ")  &lt;p&gt;response.write (request.servervariables("AUTH_USER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("AUTH_TYPE: ")  &lt;p&gt;response.write (request.servervariables("AUTH_TYPE"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_COOKIE: ")  &lt;p&gt;response.write (request.servervariables("CERT_COOKIE"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_ISSUER: ")  &lt;p&gt;response.write (request.servervariables("CERT_ISSUER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_KEYSIZE: ")  &lt;p&gt;response.write (request.servervariables("CERT_KEYSIZE"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SERIALNUMBER: ")  &lt;p&gt;response.write (request.servervariables("CERT_SERIALNUMBER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SERVER_ISSUER: ")  &lt;p&gt;response.write (request.servervariables("CERT_SERVER_ISSUER"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SERVER_SUBJECT: ")  &lt;p&gt;response.write (request.servervariables("CERT_SERVER_SUBJECT"))  &lt;p&gt;response.write ("&amp;lt;BR&amp;gt;")  &lt;p&gt;response.write ("CERT_SUBJECT: ")  &lt;p&gt;response.write (request.servervariables("CERT_SUBJECT"))  &lt;p&gt;%&amp;gt;  &lt;p&gt;Now in our example we try accessing the above script and we get the following response:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_60.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="384" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_29.png" width="720" border="0"&gt;&lt;/a&gt;  &lt;p&gt;In the above step, if you disable Client cert and enable windows integrated authentication only, you should see something similar to the one shown below:  &lt;p&gt;Check the Authentication type.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_62.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="384" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_30.png" width="720" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Similarly you can try Many-to-1 mapping, please read MSDN/KB articles that talk about how to set it up…it’s very similar to 1 to 1 mapping.  &lt;p&gt;I would like to discuss Active Directory Mapping in particular here:  &lt;p&gt;We need to have Client certificate enabled, we can remove 1-to-1 and many-to-1 mapping from IIS Manager since we need to enable AD mapping.  &lt;p&gt;In AD mapping we need to follow the following steps:  &lt;p&gt;Go to the IIS Manager, right click on root level &lt;b&gt;&lt;i&gt;WEBSITES-&amp;gt;Properties-&amp;gt;Directory Security&lt;/i&gt;&lt;/b&gt;.  &lt;p&gt;Select “Enable the windows directory service mapper”.  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_64.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_31.png" width="668" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Now go to Active directory, open Active directory users and computers, go to Users, and then select the user for which you want to map the certificate.  &lt;p&gt;Right click on the user name, go to &lt;b&gt;&lt;i&gt;Name Mappings&lt;/i&gt;&lt;/b&gt;. Add the client certificate. Now we have a mapping for that certificate to a user account in the AD.  &lt;p&gt;Go to the client machine and logon with the user credentials , and then try accessing the site now, and now you should be able to access the page and you should see the Logon name in the webpage, here the logon name will correspond to the same user with which we have associated the client certificate in the AD.  &lt;p&gt;Now you should see something like this:  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_66.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="478" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/HowtosetupIISandADforClientcertificateau_1499E/image_thumb_32.png" width="668" border="0"&gt;&lt;/a&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;Remember this:&lt;/u&gt;&lt;/b&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;Here is an excerpt from a TechNet article:&lt;/i&gt;&lt;/b&gt;  &lt;p&gt;In Active Directory mapping, when the IIS server receives a certificate from the user, it passes it on to Active Directory, which maps it to a Windows 2000/2003 user account. The IIS server then logs this account on.  &lt;p&gt;Active directory mapping is most useful when the account mappings are the same on all IIS servers. Administration is simplified because the mapping is done in only one place.  &lt;p&gt;Mapping in Active Directory can happen in one of two ways. The administrator can explicitly map a certificate to a user's account. This certificate can come from any source--as long as the root CA for that certificate is trusted for client authentication.  &lt;p&gt;UPN mapping can also be used. A UPN is automatically put into a certificate issued by an enterprise CA. If a certificate is passed to Active Directory for mapping, it is first examined for UPN mapping. If UPN mapping is not possible, the mapping set by the administrator is used.  &lt;p&gt;UPNs are in the form of userid@domain. If the certificate contains a UPN, the domain is within the hierarchy of the directory, and the CA that issued the certificate is trusted to put UPNs in the certificate, then the user's account is retrieved from the directory and logged on. All these conditions must be true before the user's account is retrieved. If any of these conditions is false, the directory is searched for a mapping set by the administrator.  &lt;p&gt;In Active Directory mapping, when the IIS server receives a certificate from the user, it passes it on to Active Directory, which maps it to a Windows 2000 or Windows Server 2003 user account. The IIS server then logs on the account.  &lt;p&gt;You can create an Active Directory mapping in one of two ways. You can rely on UPN mapping, or, if UPN mapping is not possible, you can manually map a certificate to the account of a user.  &lt;p&gt;Use Active Directory mapping when the account mappings are identical on all IIS servers. Active Directory mapping is easier to maintain than IIS mapping because you only have to create the mapping in one location.  &lt;p&gt;&lt;b&gt;&lt;i&gt;NOTE:&lt;/i&gt;&lt;/b&gt; Let’s assume that the user account with which we are trying to access the site doesn’t have a UPN name in the AD (this might happen in the case where the logged on user is a local user and not a Domain user) then in that case the logon credentials for the request will be the mapped user account for the certificate in the AD. Else, if the client certificate’s “Issued to” is a domain user account, then logon credentials will use that Account and not the mapped account associated with certificate. Also it will not respect user’s logged on credentials or server authentication method in IIS manager.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2130289" 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/Setup/default.aspx">Setup</category></item><item><title>Kerberos troubleshooting from IIS perspective</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/01/29/kerberos-troubleshooting-from-iis-perspective.aspx</link><pubDate>Mon, 29 Jan 2007 09:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1550261</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/1550261.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=1550261</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=1550261</wfw:comment><description>&lt;P&gt;Hi All, &lt;/P&gt;
&lt;P&gt;This is my first posting in the blog. &lt;/P&gt;
&lt;P&gt;I really had to take enough courage to start blogging, but with some help from one of my mentors in MS, I am finally here. &lt;/P&gt;
&lt;P&gt;I hope people really get benefitted from the articles that I post in here. &lt;/P&gt;
&lt;P&gt;Today, I am going to talk about how to implement Kerberos authentication for IIS. I have chosen this topic after a lot of consideration. This topic has always evoked a state of anxiety and fear among Web administrators and MS PSS support engineers alike. Also this has been a pain for us since a lot of calls that we receive are related to Kerberos authentication failure and causes a lot of labor and revenue loss to MS and customers. &lt;/P&gt;
&lt;P&gt;So here it goes... &lt;/P&gt;
&lt;P&gt;So what exactly is this Kerberos, first time when I heard of it I thought it must be some mystical word related to enchantment and what not. I went and looked into the dictionary and found something similar. It meant a fierce three-headed dog figure from Greek mythology that guarded the gates of the underworld. Kerberos protocol, similar to the dog figure has three main sections: client, server and an intermediary called Key distribution centre (KDC). &lt;/P&gt;
&lt;P&gt;So how exactly is this Kerberos protocol work: &lt;/P&gt;
&lt;P&gt;There are numerous articles that you can find which will give you an insight as to how Kerberos protocol works, so instead of explaining some redundant stuffs here which might confuse you a bit more (like the way it did to meJ), I will be very lucid and straight in my explanation, and concentrate more on troubleshooting than getting into various jargons associated with it. Let me know if you need articles on the topic and I can post it here. &lt;/P&gt;
&lt;P&gt;Simply speaking, a client requests a ticket (or token) from an Intermediary called Key Distribution centre (KDC) for accessing any service registered with it. In our case to access a web service, it looks for an authenticated token to access the web services, and once getting a unique short-term session key from the KDC, directly contacts the IIS server hosting the web service. IIS in turn receives the token its own session key and since it is authenticated by the KDC with which the IIS service has been registered authenticates the client to access the application running on it. Remember authentication and authorization are two different terms. A client might be authenticated still might not be able to access the resource because of lack of authorization to access it. &lt;/P&gt;
&lt;P&gt;To understand the details of how a Kerberos protocol works, I recommend reading MS knowledge base or Technet. &lt;/P&gt;
&lt;P&gt;Before you configure Kerberos authentication for your site, I recommend having these tools handy: &lt;/P&gt;
&lt;P&gt;SETSPN (For adding, listing, deleting SPN entries for a domain) &lt;/P&gt;
&lt;P&gt;KERBTRAY (For checking the Kerberos ticket used by the client to access a web server. It gives you information as to which ticket is being used by the client to access the IIS server, and whether the ticket is capable of delegation). &lt;/P&gt;
&lt;P&gt;I will take up a scenario where you want to implement Kerberos delegation to work in this architecture. It is also called double-hop since client's credentials are hopped twice from the client to the IIS web server to the backend SQL server to access a resource. I suggest there are very good articles present elsewhere on Microsoft site where you can get in depth information on how Kerberos authentication works. I have concentrated more on troubleshooting, so you can skip to the next section J. &lt;/P&gt;
&lt;P&gt;We assume client, IIS server and the backend SQL server in the same domain. The same scenario will also work if you have the components in different domains but they are mutually trusted both ways. &lt;/P&gt;
&lt;P&gt;As a troubleshooting process, start with only Basic authentication enabled on IIS server and then test from a client machine to see if that works successfully. If it works, we are good to proceed further with Windows integrated authentication as the only enabled authentication on IIS (make sure that we do not have Anonymous authentication selected in the IIS mmc console). &lt;/P&gt;
&lt;P&gt;&lt;I&gt;The following checklist gives you an insight of the basic configuration required for Kerberos to work in double hop scenario from IIS perspective.&lt;/I&gt; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Non-NLB Scenario&lt;/B&gt; &lt;/P&gt;
&lt;P&gt;IE : IIS : SQL Server &lt;BR&gt;=============================== &lt;BR&gt;IE-IIS-Share &lt;BR&gt;{All using default accounts, for eg. In IIS 6.0, app pool running under Network service or Local system.} &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;IE: &lt;BR&gt;- Add the URL to "Local Intranet Zone" &lt;BR&gt;- Enable Windows Integrated Authentication &lt;BR&gt;- Automatic logon with current username and password or, Automatic logon only in Intranet Zone &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;IIS: &lt;BR&gt;- Only "Windows Integrated Authentication" is checked. &lt;BR&gt;Type in &amp;gt; cscript adsutil.vbs get w3svc/ntauthenticationproviders (You need to run this from &amp;lt;system drive&amp;gt;/inetpub/adminscripts) &lt;BR&gt;- Make sure that this command shows &amp;gt; Negotiate, NTLM; or there is no value set. &lt;BR&gt;Else type in &amp;gt; cscript adsutil.vbs set w3svc/ntauthenticationproviders Negotiate, NTLM &lt;BR&gt;- Make sure to cross check the same at individual website/virtual directory level by using the command &amp;gt; cscript adsutil.vbs find ntauthenticationproviders. &lt;BR&gt;SPN: &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;computer-name&amp;gt;&lt;STRIKE&gt;:&amp;lt;port&amp;gt;&lt;/STRIKE&gt; &amp;lt;iis-computer-name&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN&amp;gt; &amp;lt;iis computer-name&amp;gt; &lt;BR&gt;&lt;STRIKE&gt;CAUTION: Putting the &amp;lt;port&amp;gt; has been dicey. At times it works and at times it doesn't (only my own experienceJ).&lt;/STRIKE&gt; I will recommend not using it when you set the SPN.&lt;BR&gt;Domain Controller (DC): &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp; Under Active Directory Users and Computers -&amp;gt; &amp;lt;Domain&amp;gt; -&amp;gt; Computers, Select the IIS server, right click -&amp;gt;Properties-&amp;gt;Delegation tab &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Make sure that "Trust this Computer for delegation to any service (Kerberos only) is selected, or else "Trust this computer for delegation to specified services only" is selected. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (You will get this option if the Domain functional level is Windows Server 2003 only). &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The 1st option is more generic and is good while you are implementing it for testing the first time. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When the 2nd option is checked, you can go ahead with any of the options: "Use Kerberos only" or "Use any authentication protocol". In such a case make sure that you are selecting the right service Type running on the backend service for which you need delegation. Let's say if you have SQL server running at the backend to which you want the IIS to delegate the credentials, we need to add service type as "MSSQLSVC" and default port as 1433. &lt;BR&gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt; &lt;BR&gt;IE-IIS-Share &lt;BR&gt;{App Pool running under Domain account} &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;Domain account configuration: &lt;BR&gt;- Account is trusted for delegation &lt;BR&gt;- Is a member of IIS_WPG group on the local IIS computer &lt;BR&gt;- Has "Act as a part of Operating System"/"Impersonate a client after authentication" privileges. &lt;BR&gt;IE: &lt;BR&gt;- Add the URL to "Local Intranet Zone" &lt;BR&gt;- Enable Windows Integrated Authentication &lt;BR&gt;- Automatic logon with current username and password or, Automatic logon only in Intranet Zone. &lt;BR&gt;IIS: &lt;BR&gt;- Only "Windows Integrated Authentication" is checked. &lt;BR&gt;Type in &amp;gt; cscript adsutil.vbs get w3svc/ntauthenticationproviders (You need to run this from &amp;lt;system drive&amp;gt;/inetpub/adminscripts) &lt;BR&gt;- Make sure that this command shows &amp;gt; Negotiate, NTLM; or there is no value set. &lt;BR&gt;Else type in &amp;gt; cscript adsutil.vbs set w3svc/ntauthenticationproviders Negotiate, NTLM &lt;BR&gt;- Make sure to cross check the same at individual website/virtual directory level by using the command &amp;gt; cscript adsutil.vbs find ntauthenticationproviders. &lt;BR&gt;SPN: &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add the following: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;computer-name&amp;gt;&lt;STRIKE&gt;:&amp;lt;port&amp;gt;&lt;/STRIKE&gt; &amp;lt;domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN&amp;gt; &amp;lt;domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove the following: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;computer-name&amp;gt;&lt;STRIKE&gt;:&amp;lt;port&amp;gt;&lt;/STRIKE&gt; &amp;lt;iis-computer-name&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN&amp;gt; &amp;lt;iis-computer-name&amp;gt; &lt;BR&gt;&lt;STRIKE&gt;CAUTION: Putting the &amp;lt;port&amp;gt; has been dicey. At times it works and at times it doesn't.&lt;/STRIKE&gt; I will recommend not using it when you set the SPN. &lt;BR&gt;Domain Controller (DC): &lt;BR&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp; Under Active Directory Users and Computers -&amp;gt; &amp;lt;Domain&amp;gt; -&amp;gt; Computers , Select the IIS server, right click -&amp;gt;Properties-&amp;gt;Delegation tab &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Make sure that "Trust this Computer for delegation to any service (Kerberos only) is selected, or else "Trust this computer for delegation to specified services only" is selected. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (You will get this option if the Domain functional level is Windows Server 2003 only). &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The 1st option is more generic and is good while you are implementing it for the first time. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When the 2nd option is checked, you can go ahead with any of the options: "Use Kerberos only" or "Use any authentication protocol". In such a case make sure that you are selecting the right service Type running on the backend service for which you need delegation. Let's say if you have SQL server running at the backend to which you want the IIS to delegate the credentials, we need to add service type as "MSSQLSVC" and default port as 1433. &lt;BR&gt;If you still encounter problems try checking for duplicate SPNs. &lt;BR&gt;- To find duplicate SPNs &lt;BR&gt;&amp;nbsp; Use command prompt to execute this command on dc: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;B&gt;ldifde&lt;/B&gt; -f &amp;lt;filename&amp;gt; -d "&amp;lt;dc=domain-netbiosname,dc=primary-domain&amp;gt;" -l serviceprincipalname -r "(serviceprincipalname=&amp;lt;serviceprincipalname-to-check-for-duplicates&amp;gt;)" -p subtree &lt;BR&gt;e.g. if the domain name is test.abcd.com: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldifde –f C:\log.txt -d "dc=test, dc=abcd, dc=com"-l serviceprincipalname –r "(serviceprinicpalname=http/test.abcd.com)" -p subtree &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;NLB Scenario&lt;/B&gt; &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;Now we will talk about a scenario where IIS server is a part of Network load balancer (NLB). First thing, make sure that Kerberos is supported by your NLB (hardware or software). The settings for Kerberos are a bit different when you configure it for IIS servers running as NLB nodes. Here you don't have to set SPNs for individual IIS nodes; rather you need to set an SPN entry for the Virtual IP or alias of the Load balancer. It can be hardware or software. &lt;/P&gt;
&lt;P&gt;IE-IIS-Share &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;{All using default accounts} &lt;BR&gt;-------------------------------------------------------- &lt;BR&gt;IE: &lt;BR&gt;- Add the URL (here the URL is the NLB's virtual URL or alias) to "Local Intranet Zone" &lt;BR&gt;- Enable Windows Integrated Authentication (Internet Options-&amp;gt;Advanced-&amp;gt;Security) &lt;BR&gt;- "Automatic logon with current username and password" or "Automatic Logon only in Intranet Zone" &lt;/P&gt;
&lt;P&gt;IIS: &lt;BR&gt;Type in &amp;gt; cscript adsutil.vbs get w3svc/ntauthenticationproviders (You need to run this from &amp;lt;system drive&amp;gt;/inetpub/adminscripts) &lt;BR&gt;- Make sure that this command shows &amp;gt; Negotiate, NTLM; or there is no value set. &lt;BR&gt;Else type in &amp;gt; cscript adsutil.vbs set w3svc/ntauthenticationproviders Negotiate, NTLM &lt;BR&gt;- Make sure to cross check the same at individual website/virtual directory level by using the command &amp;gt; cscript adsutil.vbs find ntauthenticationproviders. &lt;BR&gt;- Setup the IIS Servers for delegation as mentioned in the above steps. &lt;BR&gt;- Only "Windows Integrated Authentication" is used in IIS. &lt;BR&gt;- If it's an NLB environment, we need to run the IIS application under an App pool running with domain user account. &lt;BR&gt;- The domain user account should be trusted for delegation in the Active Directory. &lt;BR&gt;&amp;nbsp;&amp;nbsp; From Active Directory Users and Computers, go to the properties of the IIS User (Domain user account). On the Delegation Tab, select "Trust this user for delegation to any service (Kerberos only)" &lt;BR&gt;- The domain user account should be a part of IIS node's IIS_WPG group. &lt;BR&gt;- We need to set the above settings for all the IIS nodes in the NLB. &lt;BR&gt;- Also add the same host header entry for the NLB URL in all the IIS nodes in the IIS manager console -&amp;gt;&amp;lt;website&amp;gt;-&amp;gt;Properties-&amp;gt;Web Site-&amp;gt; Advanced tab. &lt;/P&gt;
&lt;P&gt;SPN: &lt;BR&gt;- For IIS: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;Netbios name of the NLB&amp;gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http/&amp;lt;FQDN of the NLB&amp;gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; (If we are running the site on port 80, otherwise http/&amp;lt;FQDN of the NLB&amp;gt;&lt;STRIKE&gt;:&amp;lt;Port&amp;gt;&lt;/STRIKE&gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRIKE&gt;CAUTION: Putting the &amp;lt;port&amp;gt; has been dicey. At times it works and at times it doesn't.&lt;/STRIKE&gt; I will recommend not using it when you set the SPN even when your site is running under a different port other than the default 80.&lt;/P&gt;
&lt;P&gt;We need to make sure that we do NOT have SPN entries set for http/&amp;lt;FQDN&amp;gt;&amp;nbsp; &amp;lt;iis computer-name&amp;gt; for any of the IIS nodes. &lt;/P&gt;
&lt;P&gt;Command: &amp;gt;Setspn –A http/&amp;lt;FQDN of the NLB&amp;gt;&amp;nbsp; &amp;lt;Domain user account&amp;gt; &lt;BR&gt;When we are using Constrained delegation make sure that the backend service is listed in list of services, for e.g. in case we are connecting to SQL server at the backend add MSSQLSVC in the Machine/user properties-&amp;gt;Delegation tab. &lt;BR&gt;Note: When we are accessing the web application from a client machine, I suggest installing Kerbtray on the client machine and checking for the "OK as Delegate" option in the attributes section for the corresponding SPN. If it is selected it means the ticket can be used for delegating credentials from the IIS server to the backend server. If it is not then it means there are some issues with the settings in IIS or somewhere else. Using Netmon trace is always a good idea to figure out what tickets are being used or looked for by the Client when accessing the Web application. &lt;/P&gt;
&lt;P&gt;In case you face any issues related to Kerberos authentication failure, do the following to understand more from the event logs &lt;BR&gt;- Make sure that we have enabled Kerberos logging according to &lt;A href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;262177" mce_href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;262177"&gt;http://support.microsoft.com/default.aspx?scid=kb;EN-US;262177&lt;/A&gt; on all the IIS nodes. &lt;BR&gt;- Apart from that, you also need to make sure that on all the IIS servers, these two settings are enabled. &lt;/P&gt;
&lt;P&gt;Start-&amp;gt;Programs-&amp;gt;Administrative tools-&amp;gt;Local security Policy-&amp;gt;Security settings-&amp;gt;Local Policies-&amp;gt;Audit Policy-&amp;gt;Audit account logon events-&amp;gt;"Success, Failure". &lt;/P&gt;
&lt;P&gt;Start-&amp;gt;Programs-&amp;gt;Administrative tools-&amp;gt;Local security Policy-&amp;gt;Security settings-&amp;gt;Local Policies-&amp;gt;Audit Policy-&amp;gt;Audit logon events-&amp;gt;"Success, Failure". &lt;/P&gt;
&lt;P&gt;NOTE: &lt;/P&gt;
&lt;P&gt;At times making sure all the above changes are done properly doesn't help, and in such cases make sure that we purge all the kerberos tickets using Klist or Kerbtray. In fact if possible logoff and re-login to the client machine from where you are testing the web application for kerberos authentication so that the client is issued a fresh ticket. &lt;/P&gt;
&lt;P&gt;Additional Info: &lt;BR&gt;================&lt;/P&gt;
&lt;P&gt;You might see this error in the event logs in DC: &lt;BR&gt;Event Type: Error &lt;BR&gt;Event Source: KDC &lt;BR&gt;Event Category: None &lt;BR&gt;Event ID: 11 &lt;BR&gt;Date: 4/1/2002 &lt;BR&gt;Time: 1:40:14 PM &lt;BR&gt;User: N/A &lt;BR&gt;Computer: ComputerName Description: &lt;BR&gt;There are multiple accounts with name host/mycomputer.mydomain.com of type 10. &lt;/P&gt;
&lt;P&gt;This might be because of Duplicate SPNs. There are two or more computer accounts that have the same service principal names (SPNs) registered. Please refer to KB 321044 for further info. Remember, you can use &lt;B&gt;Ldifde&lt;/B&gt; to check for duplicate SPNs as mentioned above.&lt;BR&gt;Few Links: &lt;BR&gt;For configuring backend SQL server to accept Kerberos authentication go through this link: &lt;A href="http://support.microsoft.com/kb/319723/en-us" mce_href="http://support.microsoft.com/kb/319723/en-us"&gt;http://support.microsoft.com/kb/319723/en-us&lt;/A&gt; &lt;BR&gt;Also a good article on IIS Kerberos authentication &lt;A href="http://support.microsoft.com/kb/907272/en-us" mce_href="http://support.microsoft.com/kb/907272/en-us"&gt;http://support.microsoft.com/kb/907272/en-us&lt;/A&gt; and &lt;A href="http://support.microsoft.com/?id=929650"&gt;http://support.microsoft.com/?id=929650&lt;/A&gt;&lt;BR&gt;How to configure an Asp.Net application for a delegation scenario: &lt;A href="http://support.microsoft.com/kb/810572/" mce_href="http://support.microsoft.com/kb/810572/"&gt;http://support.microsoft.com/kb/810572/&lt;/A&gt; &lt;BR&gt;PS: Remember to test whether delegation is working fine, you need to access the website URL from a workstation (client) browser and not from IIS server itself. &lt;/P&gt;
&lt;P&gt;Reason: IIS uses NTLM credentials when accessing the backend when request reaches it from the local server if, Kerberos fails and there is only single hop involved. NTLM will work with single hop and hence if you access a site locally from the IIS web server it is a single hop and not a double hop scenario.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;One simple &lt;A title="what is mantra?" href="http://www.thefreedictionary.com/mantra" target=_blank mce_href="http://www.thefreedictionary.com/mantra"&gt;mantra&lt;/A&gt; to be remembered always: You can have multiple different SPNs registered under an account but not the other way, i.e. you should not have the same SPN registered under multiple accounts because it leads to duplicate SPN issue.&lt;/P&gt;
&lt;P&gt;***************************************************** Addition to the blog&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;Think about a scenario where &lt;A href="http://server/app1"&gt;http://server/app1&lt;/A&gt; and &lt;A href="http://server/app2"&gt;http://server/app2&lt;/A&gt; are running inside a network service &amp;amp; a domain user identity respectively .&lt;BR&gt;The SPNs requested will be http/server in both the cases, and since we can’t have duplicated SPNs it won’t work. We need to then either use the same server process identity or dedicated host headers.&lt;/P&gt;
&lt;P&gt;Again,if you are using two websites with same name but different ports like &lt;A href="http://server/"&gt;http://server:80&lt;/A&gt; and &lt;A href="http://server:81/"&gt;http://server:81&lt;/A&gt;; by default IE will request a ticket for the same SPN HTTP/server.&lt;/P&gt;
&lt;P&gt;We would then need an hotfix for the client machines, &lt;A href="http://support.microsoft.com/kb/908209"&gt;http://support.microsoft.com/kb/908209&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If you have two websites &lt;A href="http://application1/"&gt;http://application1&lt;/A&gt; and &lt;A href="http://application2/"&gt;http://application2&lt;/A&gt; that are both DNS aliases (CNAMEs) of say myserver DNS host, IE will request the ticket for SPN HTTP/myserver for both the above websites. By default IE does't use port for sending the ticket and just the SPN name like, &lt;B&gt;http/mysite&lt;/B&gt;:99, It ignores the port part of it.&lt;BR&gt;Then you would need client fix &lt;A href="http://support.microsoft.com/kb/911149"&gt;http://support.microsoft.com/kb/911149&lt;/A&gt;, or use a different DNS HOSTs rather than CNAMEs.You might well go ahead with using a host headers for the websites.&lt;/P&gt;
&lt;P mce_keep="true"&gt;[Something to add here with regard to using IP Addresses to access a site...&lt;/P&gt;
&lt;P&gt;There is another confusion that people have while dealing with Kerberos authentication. At times you may want to use IP addresses to access a website and still want Kerberos authentication to work. Now in a general scenario this will not work because Kerberos requires SPN's to recognize a service like HTTP etc. You can however make it work by adding SPN's in the form: http/10.0.1.25 (website's IP) etc. This may or may not work.&lt;/P&gt;
&lt;P&gt;However we do not recommend the above way to make Kerberos work for your site using IP addresses. The reason being that SPN's should ideally be names like http/&amp;lt;somename&amp;gt; and not http/&amp;lt;some IP address&amp;gt;.&lt;/P&gt;
&lt;P&gt;Let's consider a scenario wherein users belong to domain2 and the Web server is part of domain1. Also let's assume we have mutual trust between domain1 and domain 2. When using IP addresses, client will look for SPN HTTP/10.0.1.25 (assuming this is website's IP on domain1) in domain2 (client's local domain).&lt;/P&gt;
&lt;P&gt;Now you may get into an issue wherein domain2 will not give any referral back to to the client to look into domain1 for the SPN. This can occur if IP address is being used to look for a service. In such a case even after adding SPN's for IP addresses, Kerberos won't work and will fall back to NTLM.&lt;/P&gt;
&lt;P&gt;]&lt;/P&gt;
&lt;P&gt;***Update: Regarding confusion around Port entry in SPNs, check this &lt;A href="http://technet.microsoft.com/en-us/library/cc263449.aspx#section4"&gt;http://technet.microsoft.com/en-us/library/cc263449.aspx#section4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Happy troubleshooting…and in case you still face issues, Microsoft Product Support Services (PSS) is always there to help you! &lt;/P&gt;
&lt;P&gt;Feel free to shoot me a question if you have any confusion or need some assistance.&lt;/P&gt;
&lt;P&gt;*Check the following &lt;A href="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx" target=_blank mce_href="http://blogs.msdn.com/saurabh_singh/archive/tags/Kerberos/default.aspx"&gt;link&lt;/A&gt; for my other posts related to Kerberos.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1550261" 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/Kerberos/default.aspx">Kerberos</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></item></channel></rss>