<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/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/" xmlns:cs="http://blogs.iis.net/"><channel><title>Just Another IIS Blog : appcmd</title><link>http://blogs.iis.net/thomad/archive/tags/appcmd/default.aspx</link><description>Tags: appcmd</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>IISRESET light</title><link>http://blogs.iis.net/thomad/archive/2008/05/06/iisreset-light.aspx</link><pubDate>Tue, 06 May 2008 22:41:46 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2341569</guid><dc:creator>thomad</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;font size="1"&gt;Note: This blog entry used to be on my old blog. I'm about to shut it down so I thought I replicate some of the content here.     &lt;br /&gt;&lt;/font&gt;Many IIS customers use IISRESET to get IIS back into a vanilla state. IISRESET is a pretty heavy hammer however and not needed most of the time - why would you restart FTP, WAS and W3SVC and all worker processes just because one of your web applications is locking a DLL or some content. Recycling the Application Pool causing the problem is usually enough. If you don't know which Application Pool is making the trouble you can recycle all of them. Here is how you do it with APPCMD: &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Recycling the Default Application Pool: &lt;/strong&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;%windir%\system32\inetsrv\appcmd recycle AppPool DefaultAppPool &lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;strong&gt;You can use the APPCMD piping feature to recycle all Application Pools: &lt;/strong&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;%windir%\system32\inetsrv\appcmd list apppools /xml | appcmd recycle apppools /&lt;span class="kwrd"&gt;in&lt;/span&gt; &lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Save this command as &amp;quot;%windir%\system32\IISPOOLRESET.BAT&amp;quot; and use it instead of using IISRESET.EXE. It probably takes some time to overcome the muscle memory of typing IISRESET&amp;lt;enter&amp;gt;. &lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2341569" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/thomad/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.iis.net/thomad/archive/tags/appcmd/default.aspx">appcmd</category></item><item><title>Hosting Übersites: IIS7 Support for International Domain Names (IDN)</title><link>http://blogs.iis.net/thomad/archive/2008/03/05/hosting-220-bersites-iis7-support-for-international-domain-names-idn.aspx</link><pubDate>Thu, 06 Mar 2008 06:19:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2215666</guid><dc:creator>thomad</dc:creator><slash:comments>0</slash:comments><description>&lt;P mce_keep="true"&gt;Let's suppose you are German, you developed an extremely cool web-site&amp;nbsp;and now you want to make it available to your German Bier buddies. The only really fetzig site name you could come up with contains one of these&amp;nbsp;nasty German umlauts: &lt;STRONG&gt;übersite.de&lt;/STRONG&gt; &lt;FONT size=1&gt;(not registered&amp;nbsp;at the time I'm writing this blog).&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;There are several registrars out there who allow you to register domain names that contain&amp;nbsp;Unicode characters. It's called&amp;nbsp;&lt;A class="" title="International Domain Names (IDN)" href="http://en.wikipedia.org/wiki/Internationalized_domain_name" mce_href="http://en.wikipedia.org/wiki/Internationalized_domain_name"&gt;International Domain Names (IDN)&lt;/A&gt; and IIS 7.0 and HTTP.SYS&amp;nbsp;support it nicely.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Here is what you do if you want to try it yourself: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;1) Configure IE to use IDN server names for Intranet addresses&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;You need a browser who converts IDNs into &lt;A class="" title=Punycode href="http://en.wikipedia.org/wiki/Punycode" mce_href="http://en.wikipedia.org/wiki/Punycode"&gt;punycode&lt;/A&gt;. Name resolution systems like DNS don't work with Unicode and hostnames have to be converted to punycode first. Internet Explorer 7 does this automatically for Internet addresses. For our example you need to instruct IE to do the same for Intranet addresses. Go to "Tools" - "Internet Options" - select the "Advanced" tab and scroll down to the "International" section. Check "Send IDN server names for Intranet addresses". &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;2) Generate the Punycode representation of your site name&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;We need to convert the IDN site name to Punycode because existing name resolution systems still live in the good old ASCII world. There are a couple of web sites out there which do Unicode-to-Punycode conversions. Here is one of them: &lt;A href="http://www.nameisp.com/puny.asp"&gt;http://www.nameisp.com/puny.asp&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;The resulting punycode string for&amp;nbsp;&lt;STRONG&gt;übersite.de&lt;/STRONG&gt; looks like this: &lt;STRONG&gt;xn--bersite-m2a.de&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;3) Registration of punycode name in name system&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;To keep name registration simple we register &lt;STRONG&gt;übersite.de&lt;/STRONG&gt; in our hosts file only. This will resolve the site name for local requests. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Open %windir%\system32\drivers\etc\hosts &lt;/P&gt;
&lt;P mce_keep="true"&gt;Add a new line at the end and add the following: &lt;BR&gt;&lt;STRONG&gt;127.0.0.1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xn--bersite-m2a.de&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Save and close notepad. The punycode representation of &lt;STRONG&gt;übersite.de&lt;/STRONG&gt; is now mapped to your local loopback adapter&amp;nbsp;127.0.0.1&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;4) Add a new site in IIS&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Almost there. The only thing left to do is to add &lt;STRONG&gt;übersite.de&lt;/STRONG&gt;&amp;nbsp;to IIS. Here are the commands I run in cmd.exe (make sure you run in an elevated command shell):&lt;/P&gt;
&lt;P mce_keep="true"&gt;md %systemdrive%\übersite&lt;BR&gt;echo This is the Default Document of &amp;amp;#252bersite.de &amp;gt;&amp;gt; %systemdrive%\übersite\default.htm&lt;BR&gt;%windir%\system32\inetsrv\appcmd add site -site.name:übersite -bindings:http://übersite.de:80 -physicalPath:%systemdrive%\übersite&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;5) Request übersite.de &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Now you just have to enter übersite.de into the address bar of Internet Explorer. &lt;/P&gt;
&lt;P mce_keep="true"&gt;And in case you have no idea how to enter "&lt;STRONG&gt;ü&lt;/STRONG&gt;" on your keyboard: turn on NumLock and enter &amp;lt;Alt&amp;gt;+0252. International Domain names of course do not just work for German Bier buddies but for all characters that can be represented via Unicode characters. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;FONT size=1&gt;Credits: thanks to Jeong Hwang Kim who gave me the idea to this blog entry. &lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2215666" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/thomad/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.iis.net/thomad/archive/tags/IIS+News/default.aspx">IIS News</category><category domain="http://blogs.iis.net/thomad/archive/tags/appcmd/default.aspx">appcmd</category><category domain="http://blogs.iis.net/thomad/archive/tags/IDN/default.aspx">IDN</category><category domain="http://blogs.iis.net/thomad/archive/tags/punycode/default.aspx">punycode</category></item><item><title>SSL certificates on Sites with Host Headers</title><link>http://blogs.iis.net/thomad/archive/2008/01/25/ssl-certificates-on-sites-with-host-headers.aspx</link><pubDate>Sat, 26 Jan 2008 07:06:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2134246</guid><dc:creator>thomad</dc:creator><slash:comments>0</slash:comments><description>&lt;P&gt;Today I got the following question:&lt;/P&gt;
&lt;P&gt;"I have two sites (siteV1.mysite.com and sitev2.mysite.com). They listen on the same IP address and port. We generated a certificate for siteV1.mysite.com and SSL is working properly. The problem is that some of our customers use siteV2.mysite.com and they are getting certificate errors. What's the problem?"&lt;/P&gt;
&lt;P&gt;Here is the issue: &lt;/P&gt;
&lt;P&gt;There are three pieces of data&amp;nbsp;to uniquely identify an IIS&amp;nbsp;site: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The IP address &lt;/LI&gt;
&lt;LI&gt;The Port&lt;/LI&gt;
&lt;LI&gt;The Host name which HTTP 1.1 clients send as an HTTP request header.&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;This IP:Port:Hostname triplet is called a binding. The binding "&lt;EM&gt;192.168.1.192:80:myserver"&lt;/EM&gt; for example represents&amp;nbsp;a site that listens on IP address &lt;EM&gt;192.168.1.192&lt;/EM&gt;, port &lt;EM&gt;80&lt;/EM&gt;, host-header &lt;EM&gt;myserver&lt;/EM&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The very first things IIS (HTTP.SYS to be more precise) does when a request comes in is to read the site's configuration. Connection limits and timeouts are examples of site configuration. The site binding is used to find the right site configuration. The SSL certificate seems to be another great example of site configuration - the SSL certificate is needed to decrypt the encrypted SSL data coming from the client.&lt;/P&gt;
&lt;P&gt;And the IIS User Interface certainly makes it appear as if the SSL certificate would be site configuration, too - doesn't it? In reality however you can't bind a SSL certificate to a site. The IIS UI is fooling you.&amp;nbsp;But why?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It's a chicken and egg problem: The host name is encrypted in the SSL blob that the client sends. Because&amp;nbsp;the host name is part of the binding&amp;nbsp;IIS needs the host name to lookup the right certificate. Without the host name IIS can't lookup the right site because the binding is incomplete. Without the certificate IIS can't decrypt the SSL blob that contains the host name. Game over - we are turning in circles.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;What IIS does under the covers is to ignore the host name. IIS binds the certificate to IP:Port and warns you when you try to bind a certificate to the same IP:Port combo with different host names.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there is a way if you need two different sites on the same IP:Port. You can accomplish this by getting a certificate that contains both common names, i.e. sitev1.mysite.com and sitev2.mysitem.com. Cert Authorities usually allow more than one so called "common names" in a certificate. By binding the certificate to one of the two sites you won't not get certificate errors anymore. The client is happy if one of the names in the certificate matches.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there is another caveat: you can't use the IIS7 User Interface to add a host header to an SSL site binding. You have to use command-line tools, do it programmatically or edit applicationhost.config directly. Here is an example and a &lt;A class="" title="Adding a binding via APPCMD" href="http://technet2.microsoft.com/windowsserver2008/en/library/ac19cc3c-7be9-44ef-8ea6-3af39fe69a7b1033.mspx?mfr=true" mce_href="http://technet2.microsoft.com/windowsserver2008/en/library/ac19cc3c-7be9-44ef-8ea6-3af39fe69a7b1033.mspx?mfr=true"&gt;link&lt;/A&gt; how you can it via command-line: &lt;/P&gt;
&lt;P&gt;&lt;B&gt;appcmd set site /site.name:"MySite V2"&lt;/B&gt;&lt;B&gt; /+bindings.[protocol='https',bindingInformation='*:443:sitev2.mysite.com']&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;And last but not least: with IIS7 you can use the following command to figure out what certificate is bound&amp;nbsp;to a particular IP:Port combination:&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;STRONG&gt;netsh http show sslcert&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;This command will show the IP:Port binding but also some other SSL settings. &lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2134246" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/thomad/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.iis.net/thomad/archive/tags/Host+Headers/default.aspx">Host Headers</category><category domain="http://blogs.iis.net/thomad/archive/tags/appcmd/default.aspx">appcmd</category><category domain="http://blogs.iis.net/thomad/archive/tags/SSL/default.aspx">SSL</category><category domain="http://blogs.iis.net/thomad/archive/tags/bindings/default.aspx">bindings</category></item></channel></rss>