<?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>HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx</link><description>A powerful but often under-utilized and misunderstood feature of IIS is its programmatic configuration APIs. On the one hand, all IIS administrative APIs allow programmatic, automated, and unattend configuration of IIS. On the other hand, it can be hard</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#485754</link><pubDate>Thu, 27 Oct 2005 21:23:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:485754</guid><dc:creator>Someone</dc:creator><description>Nice work, thanks</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#501126</link><pubDate>Wed, 07 Dec 2005 21:28:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:501126</guid><dc:creator>Steve</dc:creator><description>This was just what I needed.</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#520632</link><pubDate>Tue, 31 Jan 2006 17:56:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:520632</guid><dc:creator>Willy Chang</dc:creator><description>Thanks. This script saves me a lots of time. </description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#540635</link><pubDate>Tue, 28 Feb 2006 19:26:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:540635</guid><dc:creator>Levi</dc:creator><description>I am trying to use this script, and other IIS scripts that use &amp;quot;SET objWebService = GetObject( &amp;quot;IIS://&amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;/W3SVC&amp;quot; )&amp;quot;&lt;br&gt;&lt;br&gt;And I am repeatedly getting &amp;nbsp;&amp;quot;(null): Invalid syntax&amp;quot;&lt;br&gt;&lt;br&gt;Anyone have any insight?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Levi</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#540640</link><pubDate>Tue, 28 Feb 2006 19:33:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:540640</guid><dc:creator>Levi</dc:creator><description>Actually I can run the script locally on the server but not from my workstation.&lt;br&gt;&lt;br&gt;Levi</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#541138</link><pubDate>Wed, 01 Mar 2006 11:23:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:541138</guid><dc:creator>David.Wang</dc:creator><description>Levi - Make sure that IIS is actually installed on the machine you are trying to launch the script (the workstation).&lt;br&gt;&lt;br&gt;Since the GetObject() syntax is ADSI, it requires the IIS ADSI provider to be installed on both the local and remote machine... even if you are only trying to get a remote ADSI object.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#572685</link><pubDate>Mon, 10 Apr 2006 21:51:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:572685</guid><dc:creator>Tony</dc:creator><description>I get a Type mismatch when I try to access the ServerBindings property.&lt;br&gt;Any idea why?</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#572768</link><pubDate>Mon, 10 Apr 2006 23:36:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:572768</guid><dc:creator>David.Wang</dc:creator><description>Tony - Can you show the exact code snippet where you are trying to &amp;quot;access&amp;quot; the ServerBindings property that results in &amp;quot;Type mismatch&amp;quot;.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#578535</link><pubDate>Tue, 18 Apr 2006 23:57:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:578535</guid><dc:creator>Justin</dc:creator><description>Absolutely brilliant! I have a machine with over 50 websites on it each with multiplehost headers. This has saved me hours, thankyou VERY much!</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#578544</link><pubDate>Wed, 19 Apr 2006 00:16:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:578544</guid><dc:creator>David.Wang</dc:creator><description>Steve, Willy, Justin - thanks. It is what I am hoping to be able to do - provide a useful commandline tool to perform some tasks and also be a good sample for user customization - and in the end, save everyone time/effort.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#590604</link><pubDate>Fri, 05 May 2006 11:22:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:590604</guid><dc:creator>HUNG_NGO</dc:creator><description>Hi, &lt;br&gt;This script save me a lot of time. By the way, can you tell me how can I start and stop SSL service on a particular page!? Where can I find the full tutorial about the ADSI?&lt;br&gt;Anyway, thanks a lot!&lt;br&gt;Hung.</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#590736</link><pubDate>Fri, 05 May 2006 16:36:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:590736</guid><dc:creator>David.Wang</dc:creator><description>Hung_Ngo - I suggest reading Microsoft's MSDN online for the information you want, especially Script Center, which contains tons of sample script code to do just about every action for many Microsoft products.&lt;br&gt;&lt;br&gt;I do not understand what you mean by &amp;quot;stop and start SSL service on a particular page&amp;quot; - please clarify what you are trying to do.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#590930</link><pubDate>Fri, 05 May 2006 21:15:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:590930</guid><dc:creator>HUNG_NGO</dc:creator><description>Hi David,&lt;br&gt;I have found the solution. The key is on 2 KeyType w3svc/1/root/website/AccessSSL and w3svc/1/root/website/AccessSSL128.&lt;br&gt;Anyway, thanks much,&lt;br&gt;Hung.</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#594853</link><pubDate>Wed, 10 May 2006 23:47:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:594853</guid><dc:creator>Mike</dc:creator><description>How do you get the output to a text file - instead of the gui pop screens?&lt;br&gt;&lt;br&gt;thanks&lt;br&gt;&lt;br&gt;Mike</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#595279</link><pubDate>Thu, 11 May 2006 15:08:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:595279</guid><dc:creator>David.Wang</dc:creator><description>Mike - Windows support running scripts in multiple &amp;quot;hosts&amp;quot; which may display output either in a console window or as popup dialogs.&lt;br&gt;&lt;br&gt;Default host is WSCRIPT, which shows popup dialogs.&lt;br&gt;&lt;br&gt;You want to use CSCRIPT, which shows output to console window and can be piped into a text file.&lt;br&gt;&lt;br&gt;Either:&lt;br&gt;1. Launch the script one-time with CSCRIPT.EXE:&lt;br&gt; &amp;nbsp;CSCRIPT EnumWebsites.vbs&lt;br&gt;2. Change the default script host to CSCRIPT with:&lt;br&gt; &amp;nbsp;CSCRIPT //h:cscript&lt;br&gt; &amp;nbsp;EnumWebsites.vbs&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#622817</link><pubDate>Thu, 08 Jun 2006 23:40:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:622817</guid><dc:creator>Alex</dc:creator><description>Thanks for this ... two questions: &lt;br&gt;&lt;br&gt;1. How could I do the same for FTP sites and ...&lt;br&gt;&lt;br&gt;2. How can I modify values for both?</description></item><item><title>HOWTO: Enumerate IIS website and ftpsite configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#623389</link><pubDate>Fri, 09 Jun 2006 07:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:623389</guid><dc:creator>David Wang</dc:creator><description>I recently got a request to make a script to illustrate how to enumerate useful values from both Web...</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#623390</link><pubDate>Fri, 09 Jun 2006 07:17:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:623390</guid><dc:creator>David.Wang</dc:creator><description>Alex - FTP configuration works the same way as W3SVC. You can use ADSI to read and write values for both; this script shows how to read them, and if you use assignment instructions instead of read and then call SetInfo() on the objects with changed values, you'd record the modified values.&lt;br&gt;&lt;br&gt;As for how to do the same for FTP sites:&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2006/06/08/HOWTO_Enumerate_IIS_website_and_ftpsite_configuration_VBScript_using_ADSI.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2006/06/08/HOWTO_Enumerate_IIS_website_and_ftpsite_configuration_VBScript_using_ADSI.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#628472</link><pubDate>Mon, 12 Jun 2006 21:29:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:628472</guid><dc:creator>MikeMontana@hotmail.com</dc:creator><description>David, the website is awesome. thanks for your effort and answering the kinds of IIS questions that dont seem to have been answered in the last 10 years.&lt;br&gt;&lt;br&gt;Am I missing something? There seems to be no iterators for active sessions in the IIS model. I can find the &amp;quot;active session count&amp;quot;, but, can't find a collection of sessions that can be iterated. Does such a collection exist?</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#629216</link><pubDate>Tue, 13 Jun 2006 10:25:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:629216</guid><dc:creator>David.Wang</dc:creator><description>MikeMontana - there are no APIs to retrieve current runtime state, like &amp;quot;active sessions&amp;quot; in IIS. Technically, IIS has no idea about &amp;quot;sessions&amp;quot; - it only knows about requests and connections - so application frameworks like ASP/ASP.Net can offer such behavior, which is completely up to the individual frameworks.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#722074</link><pubDate>Fri, 25 Aug 2006 12:24:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:722074</guid><dc:creator>Mesut</dc:creator><description>how can i take (site id) in the (Comment) possision.</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#751986</link><pubDate>Wed, 13 Sep 2006 15:47:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:751986</guid><dc:creator>Paul</dc:creator><description>Great script. One thing tough. How can one add a listing of the Application Pool each site belongs to ?</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#751993</link><pubDate>Wed, 13 Sep 2006 15:54:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:751993</guid><dc:creator>Paul</dc:creator><description>..and howto add a listing to the homedir folder path where the files for the site's located ?</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#3819160</link><pubDate>Wed, 11 Jul 2007 23:17:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3819160</guid><dc:creator>James</dc:creator><description>&lt;p&gt;very useful!!!&lt;/p&gt;
&lt;p&gt;well, any idea how I can get the same result by using asp.net code? Then I shall be able to access those information from &amp;quot;outside&amp;quot; of the server.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#3819581</link><pubDate>Wed, 11 Jul 2007 23:48:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3819581</guid><dc:creator>jamesd</dc:creator><description>&lt;p&gt;I guess I could use asp.net code to run VBScript too, but I do prefer, if it is possible, to use pure asp.net code to get the same result.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#6807841</link><pubDate>Wed, 19 Dec 2007 19:44:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6807841</guid><dc:creator>kathyyunli@yahoo.com</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;I need get the latest created Site ID. The iisweb create a site with random large number, we don't want to use these number for site ID. Instead we want to use sequence number, for example, 1,2,3,4. We want to use script to get the largest sequence number among all the IIS web sites, then use createNewSite by passing this SITEID +1 into the parameters. &lt;/p&gt;
&lt;p&gt;Could you provide the script for us to find the latest created site ID? Thanks&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#6813893</link><pubDate>Thu, 20 Dec 2007 09:13:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6813893</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Kathy - I really think you should reconsider what you are doing.&lt;/p&gt;
&lt;p&gt;I do not think it is a good idea to create and use sequential site ID because the ID is an internal implementation detail of IIS not meant for end-user consumption.&lt;/p&gt;
&lt;p&gt;For example, what happens when you move to IIS7 and Site ID becomes deprecated? What happens when you move to IIS6 and Site ID is no longer sequential?&lt;/p&gt;
&lt;p&gt;Instead of fighting to keep sequential site ID, you should write your code to not use site ID. IIS6 generates the Site ID based on a hash of the website's friendly name, so it is possible to create sites with matching IDs on multiple computers (for synchronization) - without knowing the site ID itself&lt;/p&gt;
&lt;p&gt;Thus, I refrain from providing non-optimal legacy code that I know will be broken in the future.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#6975813</link><pubDate>Fri, 04 Jan 2008 09:14:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6975813</guid><dc:creator>Doc</dc:creator><description>&lt;p&gt;This script leaves out gather any info on child VDir websites.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#7003907</link><pubDate>Sun, 06 Jan 2008 13:22:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7003907</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Doc - Please search for and see this blog entry: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Read my BIO for the answer to why and what I blog the way I do. &lt;/p&gt;
&lt;p&gt;In short, saying &amp;quot;this script doesn't do X&amp;quot; is just complaining. Now, it has never been anyone's responsibility to resolve your complaints, so voicing them really gets nothing.&lt;/p&gt;
&lt;p&gt;Now, it is much, much better to ask &amp;quot;how to do X&amp;quot; and then do it yourself... and I will certainly help anyone learn how to do X.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#7066946</link><pubDate>Fri, 11 Jan 2008 07:20:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7066946</guid><dc:creator>Doc</dc:creator><description>&lt;p&gt;You're correct and my apologies then.&lt;/p&gt;
&lt;p&gt;I guess I've been posting on CodeProject too much.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#7314362</link><pubDate>Wed, 30 Jan 2008 02:05:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7314362</guid><dc:creator>anne</dc:creator><description>&lt;p&gt;what a wonderful tool. you rock! &amp;nbsp;thanks.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#7520590</link><pubDate>Thu, 07 Feb 2008 20:14:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7520590</guid><dc:creator>Patrick</dc:creator><description>&lt;p&gt;We just took over a company that had hundreds of websites on old NT4 boxes... This tool has saved us a huge amount of work... many thanks&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8117204</link><pubDate>Sun, 09 Mar 2008 15:03:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8117204</guid><dc:creator>Bryan Ferriby</dc:creator><description>&lt;p&gt;I would like to allow my web designer to be able to add a Index.asp document to a website and then move it up to the top of the list. &amp;nbsp;I dont want them to use the IIS interface as it allows too much scope for messing up. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Anyone got any ideas?&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8164428</link><pubDate>Wed, 12 Mar 2008 03:46:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8164428</guid><dc:creator>Richard Bailey</dc:creator><description>&lt;p&gt;Here is a convergence and alteration of the above script - that does a ping test first. &amp;nbsp;Ping-test example comes from here: &lt;a rel="nofollow" target="_new" href="http://www.scriptinganswers.com/vault/Registry/"&gt;http://www.scriptinganswers.com/vault/Registry/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;the script below is nasty, and has has some hard coded paths which could easily be cleaned up by someone who needed to run it regularly... I just needed it to run once to collect all of the websites, siteid, and logfile path for about 200 web servers.&lt;/p&gt;
&lt;p&gt;'begin&lt;/p&gt;
&lt;p&gt;Const HKEY_LOCAL_MACHINE = &amp;amp;H80000002&lt;/p&gt;
&lt;p&gt;Const ForAppending = 8&lt;/p&gt;
&lt;p&gt;DIM strServer&lt;/p&gt;
&lt;p&gt;DIM objWebService&lt;/p&gt;
&lt;p&gt;Dim objFSO, objFolder, objShell, objFile, objFSOText, strDirectory, strFile, objTextFile&lt;/p&gt;
&lt;p&gt;strDirectory = &amp;quot;c:\temp\site_collection&amp;quot;&lt;/p&gt;
&lt;p&gt;strFile = &amp;quot;\web_site_logdir_collection.csv&amp;quot;&lt;/p&gt;
&lt;p&gt;' Grab computer names from a list and insert into the script&lt;/p&gt;
&lt;p&gt;Set objFSO = Wscript.CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set objFile = objFSO.OpenTextFile(&amp;quot;c:\temp\site_collection\ComputerList.txt&amp;quot;)&lt;/p&gt;
&lt;p&gt;' Create files for logging errors&lt;/p&gt;
&lt;p&gt;Set objNoPing = objFSO.CreateTextFile(&amp;quot;c:\temp\site_collection\NoPing.txt&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set objErrorLog = objFSO.CreateTextFile(&amp;quot;c:\temp\site_collection\ErrorLog.txt&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set objFSO2 = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set objTextFile = objFSO2.OpenTextFile (strDirectory &amp;amp; strFile, ForAppending, True)&lt;/p&gt;
&lt;p&gt;' Read through text stream&lt;/p&gt;
&lt;p&gt;Do Until objFile.AtEndOfStream&lt;/p&gt;
&lt;p&gt;strServer = Trim(objFile.ReadLine)&lt;/p&gt;
&lt;p&gt;On Error Resume Next&lt;/p&gt;
&lt;p&gt;'Test to see if the computer is reachable by ping&lt;/p&gt;
&lt;p&gt;If IsAlive(strServer) = TRUE Then&lt;/p&gt;
&lt;p&gt;' get IIS info&lt;/p&gt;
&lt;p&gt;		SET objWebService = GetObject( &amp;quot;IIS://&amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;/W3SVC&amp;quot; )				&lt;/p&gt;
&lt;p&gt;		EnumWebsites objWebService&lt;/p&gt;
&lt;p&gt;						If Error &amp;lt;&amp;gt; 0 Then&lt;/p&gt;
&lt;p&gt;							objErrorLog.Writeline &amp;quot;Error on &amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;:&amp;quot; &amp;amp; Err.Number &amp;amp; &amp;quot;, &amp;quot; &amp;amp; Err.Description&lt;/p&gt;
&lt;p&gt;						End If&lt;/p&gt;
&lt;p&gt;' Write a line to the leftovers file to be run against later&lt;/p&gt;
&lt;p&gt;ElseIf IsAlive(strServer) = FALSE Then&lt;/p&gt;
&lt;p&gt;		objNoPing.Writeline strServer&lt;/p&gt;
&lt;p&gt;End If&lt;/p&gt;
&lt;p&gt;' Loop through to next computer in textfile&lt;/p&gt;
&lt;p&gt;Loop&lt;/p&gt;
&lt;p&gt;' At end of text stream, close open files&lt;/p&gt;
&lt;p&gt;objFile.Close&lt;/p&gt;
&lt;p&gt;objNoPing.Close&lt;/p&gt;
&lt;p&gt;objErrorLog.Close&lt;/p&gt;
&lt;p&gt;SUB EnumWebsites( objWebService )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM objWebServer, strSecureBind, strServerBind, strBindings, strOutput, strEnd, intLength&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR EACH objWebServer IN objWebService&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF objWebserver.Class = &amp;quot;IIsWebServer&amp;quot; THEN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'WScript.Echo objWebserver.Name &amp;amp; &amp;quot;;&amp;quot; &amp;amp; objWebServer.ServerComment &amp;amp; &amp;quot;;&amp;quot; &amp;amp; State2Desc( objWebserver.ServerState ) &amp;amp; &amp;quot;;&amp;quot; &amp;amp; objWebServer.LogFileDirectory&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strOutput = strServer &amp;amp; &amp;quot;;&amp;quot; &amp;amp; objWebserver.Name &amp;amp; &amp;quot;;&amp;quot; &amp;amp; objWebServer.ServerComment &amp;amp; &amp;quot;;&amp;quot; &amp;amp; State2Desc( objWebserver.ServerState ) &amp;amp; &amp;quot;;&amp;quot; &amp;amp; objWebServer.LogFileDirectory&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Enumerate the HTTP bindings (ServerBindings) and&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' SSL bindings (SecureBindings)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strSecureBind = EnumBindings( objWebServer.SecureBindings )&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp;strServerBind = EnumBindings( objWebServer.ServerBindings )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strOutput = strOutput &amp;amp; &amp;quot;;&amp;quot; &amp;amp; strServerBind &amp;amp; &amp;quot;;&amp;quot; &amp;amp; strSecureBind&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objTextFile.WriteLine(strOutput)&lt;/p&gt;
&lt;p&gt;	'Wscript.Echo strOutput&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END SUB&lt;/p&gt;
&lt;p&gt;' ===============================================================================================================================&lt;/p&gt;
&lt;p&gt;Function IsAlive(strHost)&lt;/p&gt;
&lt;p&gt;' Returns True if Host responds to ping&lt;/p&gt;
&lt;p&gt;' strHost is a hostname or IP&lt;/p&gt;
&lt;p&gt;Const OpenAsASCII = 0&lt;/p&gt;
&lt;p&gt;Const FailIfNotExist = 0&lt;/p&gt;
&lt;p&gt;Const ForReading = &amp;nbsp;1&lt;/p&gt;
&lt;p&gt;Dim objShell, objFSO, sTempFile, fFile&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Set objShell = CreateObject(&amp;quot;WScript.Shell&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Set objFSO = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;sTempFile = objFSO.GetSpecialFolder(2).ShortPath &amp;amp; &amp;quot;\&amp;quot; &amp;amp; objFSO.GetTempName&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;objShell.Run &amp;quot;%comspec% /c ping.exe -n 2 -w 500 &amp;quot; &amp;amp; strHost &amp;amp; &amp;quot; &amp;gt;&amp;quot; &amp;amp; sTempFile, 0 , True&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Set fFile = objFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist, OpenAsASCII)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Select Case InStr(fFile.ReadAll, &amp;quot;TTL=&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Case 0&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsAlive = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Case Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IsAlive = True&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Select&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;fFile.Close&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; objFSO.DeleteFile(sTempFile)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Set objFSO = Nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Set objShell = Nothing&lt;/p&gt;
&lt;p&gt;End Function &lt;/p&gt;
&lt;p&gt;FUNCTION EnumBindings( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM i, strIP, strPort, strHost&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM reBinding, reMatch, reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SET reBinding = NEW RegExp&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;reBinding.Pattern = &amp;quot;([^:]*):([^:]*):(.*)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR i = LBOUND( objBindingList ) TO UBOUND( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' objBindingList( i ) is a string looking like IP:Port:Host&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SET reMatches = reBinding.Execute( objBindingList( i ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FOR EACH reMatch IN reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strIP = reMatch.SubMatches( 0 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPort = reMatch.SubMatches( 1 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strHost = reMatch.SubMatches( 2 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Do some pretty processing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strIP = &amp;quot;&amp;quot; THEN strIP = &amp;quot;All Unassigned&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strHost = &amp;quot;&amp;quot; THEN strHost = &amp;quot;*&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF LEN( strIP ) &amp;lt; 8 THEN strIP = strIP &amp;amp; &amp;quot;:&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumBindings = EnumBindings &amp;amp; &amp;quot;:&amp;quot; &amp;amp; strIP &amp;amp; &amp;quot;:&amp;quot; &amp;amp; strPort &amp;amp; &amp;quot;:&amp;quot; &amp;amp; strHost &amp;amp; &amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;FUNCTION State2Desc( nState )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SELECT CASE nState&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Starting (MD_SERVER_STATE_STARTING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 2&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Started (MD_SERVER_STATE_STARTED)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 3&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopping (MD_SERVER_STATE_STOPPING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 4&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopped (MD_SERVER_STATE_STOPPED)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 5&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Pausing (MD_SERVER_STATE_PAUSING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 6&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Paused (MD_SERVER_STATE_PAUSED)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 7&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Continuing (MD_SERVER_STATE_CONTINUING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE ELSE&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Unknown state&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;END SELECT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8164467</link><pubDate>Wed, 12 Mar 2008 03:50:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8164467</guid><dc:creator>Richard Bailey</dc:creator><description>&lt;p&gt;P.S. to post above:&lt;/p&gt;
&lt;p&gt;the following would be the header for the .csv file created, if you needed to import it&lt;/p&gt;
&lt;p&gt;Server; Site ID ; Comment ; State ; LogDir ; Standard IP Address:Port:Host:; Secure IP Address:Port:Host:&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8201978</link><pubDate>Fri, 14 Mar 2008 15:13:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8201978</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Richard - thanks for the post back.&lt;/p&gt;
&lt;p&gt;Personally, I think it is far easier and cleaner to write a tiny three line batch file wrapper around this script to do what you have added.&lt;/p&gt;
&lt;p&gt;FOR /F %I IN (&amp;quot;c:\temp\site_collection\ComputerList.txt&amp;quot;) DO (&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;PING -w 500 -n 2 %I&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;REM if server exists ERRORLEVEL=0; otherwise it is 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CSCRIPT EnumSite.vbs %I&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;With a tiny bit of ambition, one can easily compose your desired solution out of existing code. Reordering output into csv and txt format is likely one-liners with a batch wrapper around VBScript -- which is how I'd recommend performing most administrative tasks.&lt;/p&gt;
&lt;p&gt;When the tool doesn't do it all, use shell script glue to make it happen.&lt;/p&gt;
&lt;p&gt;If this was in Powershell it would be even nicer.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8329605</link><pubDate>Fri, 21 Mar 2008 20:16:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8329605</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Hi, thanks for the great script. However, I can't seem to get it running. When I run cscript siteslist.vbs I get access denied and a google search hasn't helped me. Even when I just run cscript I get an access denied. Can you point me in the direction of some solution? Thanks.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8331025</link><pubDate>Sat, 22 Mar 2008 14:34:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8331025</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Nick - unfortunately, it sounds like you are in an environment which prevents users from running scripts, and I will not be able to help your circumvent your environment's security measures.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8443648</link><pubDate>Wed, 30 Apr 2008 18:18:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8443648</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;How do you enumerate the current list of IP Addresses on the server?&lt;/p&gt;
&lt;p&gt;The IIS Management snap-in does this of course, but I cannot find what method I would use to complete this action.&lt;/p&gt;
&lt;p&gt;The purpose would be so I can enumerate the list of available IPs on the server so when I use the server binding, I can populate a listbox/combobox for ip selection rather than ip entry.&lt;/p&gt;
&lt;p&gt;I hope you can point me in the right direction. Thanks and great article!&lt;/p&gt;
&lt;p&gt; - Peter&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8500862</link><pubDate>Tue, 13 May 2008 20:16:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8500862</guid><dc:creator>SAM</dc:creator><description>&lt;p&gt;I have run into a problem running my vbscript during an install. When the targeting a Server 2008 machine with IIS 7 and IIS 6 compatability disabled, the script fails on the line &lt;/p&gt;
&lt;p&gt;Set objW3SVC = GetObject(&amp;quot;IIS://localhost/W3SVC&amp;quot;)&lt;/p&gt;
&lt;p&gt;I would rather not require IIS 6 compatabilty. Is there an easy way in vbscript to enumerate the websiltes on IIS7?&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8502657</link><pubDate>Wed, 14 May 2008 07:18:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8502657</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;SAM - all of my scripts require IIS6 Metabase Compatibility to run on IIS7. This is because they use ADSI, which requires the IIS6 Metabase Compatibility feature on IIS7.&lt;/p&gt;
&lt;p&gt;There is a new WMI and COM provider for IIS7 but code for that is IIS specific. Depending on the concepts I am illustrating, I would use different APIs. For examples, websites/vdir/ISAPI have always existed and use classic API. While Modules/Handlers originate from IIS7 and only use IIS7-specific APIs.&lt;/p&gt;
&lt;p&gt;You can use APPCMD.EXE in %windir%\System32\inetsrv to do many of the common (but not all) configuration-related tasks. You will have to read the help to determine the syntax.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8626370</link><pubDate>Fri, 20 Jun 2008 21:36:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8626370</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;I get the error: C:\web_info.vbs(17, 1) (null): Invalid syntax&lt;/p&gt;
&lt;p&gt;when I run the script.&lt;/p&gt;
&lt;p&gt;This is line 17:&lt;/p&gt;
&lt;p&gt;set objWebService = GetObject( &amp;quot;IIS://&amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;/W3SVC&amp;quot; )&lt;/p&gt;
&lt;p&gt;Does this mean I need to run the script from a server with IIS installed? Is there a way to run this from a XP machine w/o IIS to W2k3 machines that do?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8637170</link><pubDate>Sun, 22 Jun 2008 10:30:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8637170</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Michael - you need to run this script on machines with IIS installed in order to query remote machines with IIS installed, using ADSI.&lt;/p&gt;
&lt;p&gt;You won't be able to query IIS6-specific properties with ADSI from XP Pro 32bit -- for example, AppPoolId. In this case, you are querying common properties that exist both in IIS on XP and W2K3, so it is fine.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8650495</link><pubDate>Wed, 25 Jun 2008 06:30:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8650495</guid><dc:creator>dave</dc:creator><description>&lt;p&gt;thankyou thankyou thankyou!!!!!&lt;/p&gt;
&lt;p&gt;this script is exactly what i needed to obtain site ID's for a site to then use in another script to set the SSL host headers.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8650995</link><pubDate>Wed, 25 Jun 2008 08:22:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8650995</guid><dc:creator>dave</dc:creator><description>&lt;p&gt;I modified the script slightly for my purposes and thought i'd share.&lt;/p&gt;
&lt;p&gt;This asks for a website name and then uses David's script to locate the site identifier for that name.&lt;/p&gt;
&lt;p&gt;It then runs adsutil.vbs with that identifier to set the port 80 and port 443 site headers.&lt;/p&gt;
&lt;p&gt;i had to do this because the IIS Manager GUI doesn't have an option to set site headers for SSL !? Why, I have no idea... and then they go and provide us a cmd line script to do it, but that script requires the numeric site id, which is difficult to easily find out.. &amp;nbsp;Hence thanks to David's code and a little bit of addition, I was able to script this nicely so any of our administrators could do it with ease.&lt;/p&gt;
&lt;p&gt;'----------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;'---- Set WebSite Headers.vbs ----&lt;/p&gt;
&lt;p&gt;' &amp;nbsp; Written by Dave - 25.6.08&lt;/p&gt;
&lt;p&gt;'&lt;/p&gt;
&lt;p&gt;' &amp;nbsp; Code for interogating IIS metabase to obtain SiteName (site identifier)&lt;/p&gt;
&lt;p&gt;' &amp;nbsp; obtained from David Wang (&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang"&gt;http://blogs.msdn.com/david.wang&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;'&lt;/p&gt;
&lt;p&gt;' &amp;nbsp; Script uses IIS Admin Script &amp;quot;adsutil.vbs&amp;quot; which must exist&lt;/p&gt;
&lt;p&gt;' &amp;nbsp; (installed by default with IIS 6.0)&lt;/p&gt;
&lt;p&gt;'----------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;OPTION EXPLICIT&lt;/p&gt;
&lt;p&gt;DIM CRLF, TAB&lt;/p&gt;
&lt;p&gt;DIM strServer, strSiteName, strRun&lt;/p&gt;
&lt;p&gt;DIM objWebService, objShell&lt;/p&gt;
&lt;p&gt;TAB &amp;nbsp;= CHR( 9 )&lt;/p&gt;
&lt;p&gt;CRLF = CHR( 13 ) &amp;amp; CHR( 10 )&lt;/p&gt;
&lt;p&gt;SET objShell = Wscript.CreateObject(&amp;quot;Wscript.Shell&amp;quot;)&lt;/p&gt;
&lt;p&gt;SET objWebService = GetObject( &amp;quot;IIS://&amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;/W3SVC&amp;quot; )&lt;/p&gt;
&lt;p&gt;strServer = &amp;quot;localhost&amp;quot;&lt;/p&gt;
&lt;p&gt;DO&lt;/p&gt;
&lt;p&gt;	strSiteName = Inputbox(&amp;quot;This script will edit the IIS metabase to include header bindings for port 80 and SSL port 443.&amp;quot; &amp;amp; vbCrLf &amp;amp; vbcrlf &amp;amp; &amp;quot;Enter the IIS Website name&amp;quot; &amp;amp; vbCrLf &amp;amp; &amp;quot;eg. swanhill.munitec.com.au&amp;quot;, &amp;quot;Set Website headers&amp;quot;, &amp;quot;council.munitec.com.au&amp;quot;) &lt;/p&gt;
&lt;p&gt;LOOP UNTIL strSiteName &amp;lt;&amp;gt; &amp;quot;council.munitec.com.au&amp;quot;&lt;/p&gt;
&lt;p&gt;if instr(strSiteName,&amp;quot;.&amp;quot;) &amp;lt; 1 then&lt;/p&gt;
&lt;p&gt;	msgbox &amp;quot;Not a proper domain name - website name must be a fully qualified domain name&amp;quot;&lt;/p&gt;
&lt;p&gt;	wscript.quit&lt;/p&gt;
&lt;p&gt;end if&lt;/p&gt;
&lt;p&gt;'------------------------&lt;/p&gt;
&lt;p&gt;'-- run script to set headers&lt;/p&gt;
&lt;p&gt;EnumWebsitesSetHeader objWebService&lt;/p&gt;
&lt;p&gt;'-- print out web site info &amp;amp; new bindings&lt;/p&gt;
&lt;p&gt;EnumWebsites objWebService&lt;/p&gt;
&lt;p&gt;SUB EnumWebsitesSetHeader( objWebService )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM objWebServer, strBindings&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR EACH objWebServer IN objWebService&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF objWebserver.Class = &amp;quot;IIsWebServer&amp;quot; THEN&lt;/p&gt;
&lt;p&gt;		if ucase(objWebServer.ServerComment) = ucase(strSiteName) then&lt;/p&gt;
&lt;p&gt;			strRun = &amp;quot;cscript.exe C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/&amp;quot; &amp;amp;_&lt;/p&gt;
&lt;p&gt;				objWebServer.Name &amp;amp; &amp;quot;/SecureBindings &amp;quot; &amp;amp;_&lt;/p&gt;
&lt;p&gt;				&amp;quot;&amp;quot;&amp;quot;:443:&amp;quot; &amp;amp; strSiteName &amp;amp; &amp;quot;&amp;quot;&amp;quot; &amp;nbsp;&amp;quot;&lt;/p&gt;
&lt;p&gt;			objShell.Run strRun, 0, True&lt;/p&gt;
&lt;p&gt;			strRun = &amp;quot;cscript.exe C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/&amp;quot; &amp;amp;_&lt;/p&gt;
&lt;p&gt;				objWebServer.Name &amp;amp; &amp;quot;/ServerBindings &amp;quot; &amp;amp;_&lt;/p&gt;
&lt;p&gt;				&amp;quot;&amp;quot;&amp;quot;:80:&amp;quot; &amp;amp; strSiteName &amp;amp; &amp;quot;&amp;quot;&amp;quot; &amp;nbsp;&amp;quot;&lt;/p&gt;
&lt;p&gt;			objShell.Run strRun, 0, True&lt;/p&gt;
&lt;p&gt;		end if&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END SUB&lt;/p&gt;
&lt;p&gt;SUB EnumWebsites( objWebService )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM objWebServer, strBindings&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR EACH objWebServer IN objWebService&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF objWebserver.Class = &amp;quot;IIsWebServer&amp;quot; THEN&lt;/p&gt;
&lt;p&gt;		if ucase(objWebServer.ServerComment) = ucase(strSiteName) then&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	WScript.Echo _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;		&amp;quot;Site ID = &amp;quot; &amp;amp; objWebserver.Name &amp;amp; CRLF &amp;amp; _&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Server Comment = &amp;quot;&amp;quot;&amp;quot; &amp;amp; objWebServer.ServerComment &amp;amp; &amp;quot;&amp;quot;&amp;quot; &amp;quot; &amp;amp; CRLF &amp;amp; _&lt;/p&gt;
&lt;p&gt;			&amp;quot;State &amp;nbsp; = &amp;quot; &amp;amp; State2Desc( objWebserver.ServerState ) &amp;amp; CRLF &amp;amp; _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	&amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Enumerate the HTTP bindings (ServerBindings) and&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	 &amp;nbsp; &amp;nbsp;' SSL bindings (SecureBindings)&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strBindings = EnumBindings( objWebServer.ServerBindings ) &amp;amp; _&lt;/p&gt;
&lt;p&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;EnumBindings( objWebServer.SecureBindings )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	 &amp;nbsp; &amp;nbsp;IF NOT strBindings = &amp;quot;&amp;quot; THEN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	WScript.Echo &amp;quot;IP Address&amp;quot; &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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;quot;Port&amp;quot; &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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;quot;Host&amp;quot; &amp;amp; CRLF &amp;amp; _&lt;/p&gt;
&lt;p&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;strBindings&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt;		end if&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END SUB&lt;/p&gt;
&lt;p&gt;FUNCTION EnumBindings( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM i, strIP, strPort, strHost&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM reBinding, reMatch, reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SET reBinding = NEW RegExp&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;reBinding.Pattern = &amp;quot;([^:]*):([^:]*):(.*)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR i = LBOUND( objBindingList ) TO UBOUND( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' objBindingList( i ) is a string looking like IP:Port:Host&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SET reMatches = reBinding.Execute( objBindingList( i ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FOR EACH reMatch IN reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strIP = reMatch.SubMatches( 0 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPort = reMatch.SubMatches( 1 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strHost = reMatch.SubMatches( 2 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Do some pretty processing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strIP = &amp;quot;&amp;quot; THEN strIP = &amp;quot;All Unassigned&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strHost = &amp;quot;&amp;quot; THEN strHost = &amp;quot;*&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF LEN( strIP ) &amp;lt; 8 THEN strIP = strIP &amp;amp; TAB&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumBindings = EnumBindings &amp;amp; _&lt;/p&gt;
&lt;p&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; strIP &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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; strPort &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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; strHost &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumBindings = EnumBindings &amp;amp; CRLF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;FUNCTION State2Desc( nState )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SELECT CASE nState&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Starting...&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 2&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Started&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 3&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopping...&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 4&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopped&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 5&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Pausing...&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 6&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Paused&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 7&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Continuing..&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE ELSE&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Unknown state&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;END SELECT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8660484</link><pubDate>Fri, 27 Jun 2008 10:24:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8660484</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;dave - Nice script.&lt;/p&gt;
&lt;p&gt;I would have used this script to find the IIS Website ID with another one of my scripts that modify HTTP/SSL Bindings ( &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2004/12/02/273681.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2004/12/02/273681.aspx&lt;/a&gt; ) and tie the two together with a little batch file scripting such that makes this chore incredibly short and clean and with completely reusable stand-alone scripts.&lt;/p&gt;
&lt;p&gt;The reason IIS6 UI does not set Host headers for SSL is because:&lt;/p&gt;
&lt;p&gt;1. It is prohibited to alter/add UI inside of a Windows Service Pack. To do so would involve re-localization for all Windows Languages as well as a whole bunch of other work and government red-tape that end up making it not worth doing in a Service Pack.&lt;/p&gt;
&lt;p&gt;2. SSL Host headers was a bug-fix &amp;quot;feature&amp;quot; added in WS03 Service Pack 1 for HTTP.SYS for the benefit of IIS6&lt;/p&gt;
&lt;p&gt;Thus, it was either:&lt;/p&gt;
&lt;p&gt;1. Wait for Windows Server 2008 to release IIS with support for SSL Host headers&lt;/p&gt;
&lt;p&gt;2. Add SSL Host headers in WS03SP1, without UI, but a whole bunch of documents telling you how to do it&lt;/p&gt;
&lt;p&gt;I believe you'd think that we made the right choice.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8837285</link><pubDate>Wed, 06 Aug 2008 16:12:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8837285</guid><dc:creator>Michiel Bester</dc:creator><description>&lt;p&gt;Excellent work. 2 seconds to get a complete listing - and that 2 seconds included the copying of the text and renaming the vbs file:-)&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8952459</link><pubDate>Mon, 15 Sep 2008 15:08:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8952459</guid><dc:creator>Get Physical Path of a WebSite</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;Thanks for sharing the information.&lt;/p&gt;
&lt;p&gt;I have a requirement to get the &amp;quot;Physical Path&amp;quot; of a web site. &lt;/p&gt;
&lt;p&gt;In general its value for Default Web Site will be &amp;quot;%SystemDrive%\inetpub\wwwroot&amp;quot;.&lt;/p&gt;
&lt;p&gt;What property name of &amp;nbsp;&amp;quot;IIsWebServer&amp;quot; should I use to get the &amp;quot;Physical Path&amp;quot; of a web site?&lt;/p&gt;
&lt;p&gt;GIRI&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#8956562</link><pubDate>Thu, 18 Sep 2008 05:47:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8956562</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Giri - There is no such thing as &amp;quot;physical path&amp;quot; of a website. So, the property you are looking for does not exist.&lt;/p&gt;
&lt;p&gt;You can only retrieve the physical path of a certain URL, and you need to read the &amp;quot;Path&amp;quot; property of the &amp;quot;IIsWebVirtualDir&amp;quot; object to get that value.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9089401</link><pubDate>Sat, 15 Nov 2008 10:23:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9089401</guid><dc:creator>Amit Batra</dc:creator><description>&lt;p&gt;I am able to get physical path of virtual directories from iis but not if i set websites at different ports instead of creating virtual directories.&lt;/p&gt;
&lt;p&gt;Please help..&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9131995</link><pubDate>Fri, 21 Nov 2008 19:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9131995</guid><dc:creator>Xman</dc:creator><description>&lt;p&gt;Hello, How can we get properties of virtualdir under IIS://&amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;/W3SVC/N/myspace ?&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9137254</link><pubDate>Mon, 24 Nov 2008 17:15:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9137254</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Xman - I suggest looking at how %SYSTEMDRIVE%\Inetpub\AdminScripts\ADSUTIL.VBS does it when you run:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\ADSUTIL.VBS ENUM W3SVC/N/myspace&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9252601</link><pubDate>Thu, 25 Dec 2008 16:34:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9252601</guid><dc:creator>ganesh</dc:creator><description>&lt;p&gt;Advice me the script to list the website name, port number, host header, IP, SSL, and auth in all the application in the server..&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9444155</link><pubDate>Wed, 25 Feb 2009 17:59:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9444155</guid><dc:creator>CodeGecko</dc:creator><description>&lt;p&gt;This is awesome, it's saved me hours of time in the middle of a crisis.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9564073</link><pubDate>Thu, 23 Apr 2009 09:06:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9564073</guid><dc:creator>Atomic</dc:creator><description>&lt;p&gt;Hi David, &lt;/p&gt;
&lt;p&gt;your script is great! I have one question though, what if I have multiple servers to query, e.g. 100 servers to check and &amp;nbsp;not just the local machines, how do I modify the script to accomodate it? &lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9581557</link><pubDate>Fri, 01 May 2009 02:57:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9581557</guid><dc:creator>Ramesh</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;I get the following error when I try running the script.&lt;/p&gt;
&lt;p&gt;Line:17&lt;/p&gt;
&lt;p&gt;Char: 1&lt;/p&gt;
&lt;p&gt;Error: 0x80005000&lt;/p&gt;
&lt;p&gt;Code: 80005000&lt;/p&gt;
&lt;p&gt;Source: (null)&lt;/p&gt;
&lt;p&gt;I can run the script on the local host but when I specify a server within the domain i get the above error.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9589108</link><pubDate>Tue, 05 May 2009 19:01:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9589108</guid><dc:creator>Ratish</dc:creator><description>&lt;p&gt;The Script is awesome. Can someone get me a script which pulls up authentication for Default website and all other VDir's in IIS ??&lt;/p&gt;
&lt;p&gt;Ratish&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9645180</link><pubDate>Thu, 28 May 2009 03:14:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9645180</guid><dc:creator>DavidR</dc:creator><description>&lt;p&gt;Hi Guys,&lt;/p&gt;
&lt;p&gt;Have edited David's script to include listing of home directory for website content per site and also output to a txt file.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://satchelmouth.wordpress.com/2009/05/28/script-to-list-important-details-for-all-websites-in-iis6/"&gt;http://satchelmouth.wordpress.com/2009/05/28/script-to-list-important-details-for-all-websites-in-iis6/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;( I couldn't seem to post the entire script contents here, maybe a character limit? )&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9652455</link><pubDate>Fri, 29 May 2009 12:45:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9652455</guid><dc:creator>darian</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;My IIS 6 server has become a little bit of a mess and I'd like to update the ServerComment (IIS site name) from the metabase to match the primary host header value.&lt;/p&gt;
&lt;p&gt;Has anyone done that before?&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;darian&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9704357</link><pubDate>Sun, 07 Jun 2009 18:04:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9704357</guid><dc:creator>vuadapass</dc:creator><description>&lt;p&gt;Excellent work. 2 seconds to get a complete listing - and that 2 seconds included the copying of the text and renaming the vbs file:-)&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9798495</link><pubDate>Tue, 23 Jun 2009 02:27:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798495</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;David:&lt;/p&gt;
&lt;p&gt;I'm trying to access the 'objServer.DefaultDoc' value(s). &amp;nbsp;I can retrieve the values but if I update the value (add/remove a document), the 'DefaultDoc' value remains unchanged.&lt;/p&gt;
&lt;p&gt;Any ideas on how to get the current values?&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9820586</link><pubDate>Mon, 06 Jul 2009 23:35:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9820586</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Hi David. &amp;nbsp;Thanks for the great blog. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;This code returns a WMI 'Provider Load Failure' against an IIS7 server even with &amp;quot;IIS6 WMI Compatibility&amp;quot; installed. &amp;nbsp;But it will work if I add &amp;quot;IIS6 Metabase Compatibility&amp;quot;. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;So question #1 is 'Am I missing something?'&lt;/p&gt;
&lt;p&gt;And question #2 is 'How strongly should I bother resisting enabling IIS6 Metabase Compatibility -- is it that big of a deal?'&lt;/p&gt;
&lt;p&gt;	Set objWMIService = GetObject(&amp;quot;winmgmts:{authenticationLevel=pktPrivacy}!\\servername\root\MicrosoftIISv2&amp;quot;)&lt;/p&gt;
&lt;p&gt;	Set colItems = objWMIService.ExecQuery(&amp;quot;SELECT * FROM IIsApplicationPools_IIsApplicationPool&amp;quot;, &amp;quot;WQL&amp;quot;, &amp;amp;h10 + &amp;amp;h20)&lt;/p&gt;
&lt;p&gt;	Result = &amp;quot;AppPools&amp;quot; &amp;amp; vbcrlf&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; For Each objItem In colItems&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp; &amp;nbsp;Result = Result &amp;amp; objItem.PartComponent &amp;amp; vbcrlf&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; Next&lt;/p&gt;
&lt;p&gt;	WScript.Echo Result&lt;/p&gt;
&lt;p&gt;Thanks so much!&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9829361</link><pubDate>Sat, 11 Jul 2009 09:50:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9829361</guid><dc:creator>fullz releases</dc:creator><description>&lt;p&gt;Excellent work. 2 seconds to get a complete listing - and that 2 seconds included the copying of the text and renaming the vbs file:-)&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9855551</link><pubDate>Sun, 02 Aug 2009 10:38:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9855551</guid><dc:creator>sieure</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;Thanks for sharing the information.&lt;/p&gt;
&lt;p&gt;I have a requirement to get the &amp;quot;Physical Path&amp;quot; of a web site.&lt;/p&gt;
&lt;p&gt;In general its value for Default Web Site will be &amp;quot;%SystemDrive%\inetpub\wwwroot&amp;quot;.&lt;/p&gt;
&lt;p&gt;What property name of &amp;nbsp;&amp;quot;IIsWebServer&amp;quot; should I use to get the &amp;quot;Physical Path&amp;quot; of a web site?&lt;/p&gt;
&lt;p&gt;GIRI&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9855552</link><pubDate>Sun, 02 Aug 2009 10:38:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9855552</guid><dc:creator>Blackberry</dc:creator><description>&lt;p&gt; Set objWMIService = GetObject(&amp;quot;winmgmts:{authenticationLevel=pktPrivacy}!\\servername\root\MicrosoftIISv2&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set colItems = objWMIService.ExecQuery(&amp;quot;SELECT * FROM IIsApplicationPools_IIsApplicationPool&amp;quot;, &amp;quot;WQL&amp;quot;, &amp;amp;h10 + &amp;amp;h20)&lt;/p&gt;
&lt;p&gt;Result = &amp;quot;AppPools&amp;quot; &amp;amp; vbcrlf&lt;/p&gt;
&lt;p&gt; &amp;nbsp;For Each objItem In colItems&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; Result = Result &amp;amp; objItem.PartComponent &amp;amp; vbcrlf&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Next&lt;/p&gt;
&lt;p&gt;WScript.Echo Result&lt;/p&gt;
&lt;p&gt;Thanks so much!&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9855553</link><pubDate>Sun, 02 Aug 2009 10:39:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9855553</guid><dc:creator>Bảo Hiểm</dc:creator><description>&lt;p&gt;Excellent work. 2 seconds to get a complete listing - and that 2 seconds included the copying of the text and renaming the vbs file:-)&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9855554</link><pubDate>Sun, 02 Aug 2009 10:40:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9855554</guid><dc:creator>Rap</dc:creator><description>&lt;p&gt;SAM - all of my scripts require IIS6 Metabase Compatibility to run on IIS7. This is because they use ADSI, which requires the IIS6 Metabase Compatibility feature on IIS7.&lt;/p&gt;
&lt;p&gt;There is a new WMI and COM provider for IIS7 but code for that is IIS specific. Depending on the concepts I am illustrating, I would use different APIs. For examples, websites/vdir/ISAPI have always existed and use classic API. While Modules/Handlers originate from IIS7 and only use IIS7-specific APIs.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9856503</link><pubDate>Mon, 03 Aug 2009 23:50:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9856503</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Thank u for the script. &amp;nbsp;I modified it a little bit to show the IP of the server.&lt;/p&gt;
&lt;p&gt;OPTION EXPLICIT&lt;/p&gt;
&lt;p&gt;DIM CRLF, TAB&lt;/p&gt;
&lt;p&gt;DIM strServer&lt;/p&gt;
&lt;p&gt;DIM objWebService&lt;/p&gt;
&lt;p&gt;DIM strcomputer&lt;/p&gt;
&lt;p&gt;DIM objWMIService&lt;/p&gt;
&lt;p&gt;DIM colItems&lt;/p&gt;
&lt;p&gt;DIM strCount&lt;/p&gt;
&lt;p&gt;DIM objitem&lt;/p&gt;
&lt;p&gt;DIM stripaddress&lt;/p&gt;
&lt;p&gt;DIM IP&lt;/p&gt;
&lt;p&gt;TAB &amp;nbsp;= CHR( 9 )&lt;/p&gt;
&lt;p&gt;CRLF = CHR( 13 ) &amp;amp; CHR( 10 )&lt;/p&gt;
&lt;p&gt;strcomputer = &amp;quot;.&amp;quot;&lt;/p&gt;
&lt;p&gt;Set objWMIService = GetObject(&amp;quot;winmgmts:&amp;quot; _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;amp; &amp;quot;{impersonationLevel=impersonate}!\\&amp;quot; &amp;amp; strComputer &amp;amp; &amp;quot;\root\cimv2&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set colItems = objWMIService.ExecQuery _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;(&amp;quot;Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True&amp;quot;)&lt;/p&gt;
&lt;p&gt;strCount = 1&lt;/p&gt;
&lt;p&gt;For Each objitem in colitems&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;If strCount = 1 Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strIPAddress = Join(objitem.IPAddress, &amp;quot;,&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IP = stripaddress&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strCount = strCount + 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' wscript.echo IP&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt;next &lt;/p&gt;
&lt;p&gt;IF WScript.Arguments.Length = 1 THEN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;strServer = WScript.Arguments( 0 )&lt;/p&gt;
&lt;p&gt;ELSE&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;strServer = &amp;quot;localhost&amp;quot;&lt;/p&gt;
&lt;p&gt;END IF&lt;/p&gt;
&lt;p&gt;WScript.Echo &amp;quot;Enumerating websites on &amp;quot; &amp;amp; strServer &amp;amp; CRLF&lt;/p&gt;
&lt;p&gt;SET objWebService = GetObject( &amp;quot;IIS://&amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;/W3SVC&amp;quot; )&lt;/p&gt;
&lt;p&gt;EnumWebsites objWebService&lt;/p&gt;
&lt;p&gt;SUB EnumWebsites( objWebService )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM objWebServer, strBindings&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR EACH objWebServer IN objWebService&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF objWebserver.Class = &amp;quot;IIsWebServer&amp;quot; THEN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WScript.Echo _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IP &amp;amp; TAB &amp;amp; objWebserver.Name &amp;amp; TAB &amp;amp;objWebServer.ServerComment &amp;amp; TAB &amp;amp; State2Desc( objWebserver.ServerState ) &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Enumerate the HTTP bindings (ServerBindings) and&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' SSL bindings (SecureBindings)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strBindings = EnumBindings( objWebServer.ServerBindings ) &amp;amp; EnumBindings( objWebServer.SecureBindings )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF NOT strBindings = &amp;quot;&amp;quot; THEN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' WScript.Echo strBindings&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END SUB&lt;/p&gt;
&lt;p&gt;FUNCTION EnumBindings( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM i, strIP, strPort, strHost&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM reBinding, reMatch, reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SET reBinding = NEW RegExp&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;reBinding.Pattern = &amp;quot;([^:]*):([^:]*):(.*)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR i = LBOUND( objBindingList ) TO UBOUND( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' objBindingList( i ) is a string looking like IP:Port:Host&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SET reMatches = reBinding.Execute( objBindingList( i ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FOR EACH reMatch IN reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strIP = reMatch.SubMatches( 0 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPort = reMatch.SubMatches( 1 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strHost = reMatch.SubMatches( 2 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Do some pretty processing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strIP = &amp;quot;&amp;quot; THEN strIP = &amp;quot;All Unassigned&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strHost = &amp;quot;&amp;quot; THEN strHost = &amp;quot;*&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF LEN( strIP ) &amp;lt; 8 THEN strIP = strIP &amp;amp; TAB&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumBindings = EnumBindings &amp;amp; _&lt;/p&gt;
&lt;p&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; strIP &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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; strPort &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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; strHost &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumBindings = EnumBindings &amp;amp; CRLF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;FUNCTION State2Desc( nState )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SELECT CASE nState&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Starting (MD_SERVER_STATE_STARTING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 2&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Started (MD_SERVER_STATE_STARTED)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 3&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopping (MD_SERVER_STATE_STOPPING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 4&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopped (MD_SERVER_STATE_STOPPED)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 5&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Pausing (MD_SERVER_STATE_PAUSING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 6&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Paused (MD_SERVER_STATE_PAUSED)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 7&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Continuing (MD_SERVER_STATE_CONTINUING)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE ELSE&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Unknown state&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;END SELECT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;My question, and i've searched high and low. &amp;nbsp; How do i grab the header names from under &amp;quot;website properties &amp;gt; website tab &amp;gt; Advanced button &amp;gt; Host Headers?&lt;/p&gt;
&lt;p&gt;I can't find anything in how to grab that. &amp;nbsp;We are consolidating our &amp;quot;similar sites&amp;quot; and the current incarnation of the script doesn't show the host headers on the sites we combined into one site.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9858092</link><pubDate>Wed, 05 Aug 2009 17:49:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9858092</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Nevermind.. lol &amp;nbsp; in the modified script i made i inadvertantly took that part out..&lt;/p&gt;
&lt;p&gt;nothing to see, move along... :)&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9862190</link><pubDate>Sun, 09 Aug 2009 13:31:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9862190</guid><dc:creator>Gil</dc:creator><description>&lt;p&gt;Thanks for the script! Is there any way that I can receive the IP address of the IIS Server that is currently being used on my website? I have 2 IIs servers for the website and I'd like to know which was used when a user registers (a record is inserted &amp;nbsp;to the db) on my website.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9908834</link><pubDate>Sun, 18 Oct 2009 22:05:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9908834</guid><dc:creator>RoarBoy</dc:creator><description>&lt;p&gt;David, thank you so much.&lt;/p&gt;
&lt;p&gt;We used the basis of your script to deploy to over 1K+ web servers as ASP page - this allows us to target a specific page in any web site and it will obviously provide us with the info for all hosted applications - made life so much simpler for us...&lt;/p&gt;
&lt;p&gt;i.e. server name, web site names, State, IP's, etc etc...&lt;/p&gt;
&lt;p&gt;Our code is below:&lt;/p&gt;
&lt;p&gt;1.) Anonymous Authetication must be disabled on this asp file&lt;/p&gt;
&lt;p&gt;2.) Integrated Windows Authentication must be enabled on this asp file.&lt;/p&gt;
&lt;p&gt;-- Start of Code --&lt;/p&gt;
&lt;p&gt;&amp;lt;%@LANGUAGE=VBSCRIPT&lt;/p&gt;
&lt;p&gt;@ENABLESESSIONSTATE=False%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% Option Explicit %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% Response.Buffer=True %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% Response.Expires=0 %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% Response.ExpiresAbsolute=Date-1%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% Response.AddHeader &amp;quot;cache-control&amp;quot;,&amp;quot;private&amp;quot;%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;% Response.AddHeader &amp;quot;pragma&amp;quot;,&amp;quot;no-cache&amp;quot;%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;%&lt;/p&gt;
&lt;p&gt;'------- WWWinfo.asp script to obtain Server &amp;amp; WWW information -------&lt;/p&gt;
&lt;p&gt;'------- obtain Server Name -------&lt;/p&gt;
&lt;p&gt;Dim objNetwork&lt;/p&gt;
&lt;p&gt;Dim strServer&lt;/p&gt;
&lt;p&gt;Set objNetwork = CreateObject(&amp;quot;WScript.Network&amp;quot;)&lt;/p&gt;
&lt;p&gt;strServer = UCase(objNetwork.ComputerName)&lt;/p&gt;
&lt;p&gt;Set objNetwork = Nothing&lt;/p&gt;
&lt;p&gt;%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;table border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;90%&amp;quot; style=&amp;quot;font-family: Verdana; font-size: 12pt&amp;quot; &amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;lt;tr&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot; colspan=&amp;quot;9&amp;quot; background=&amp;quot;./canvas.jpg&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;./logo.gif&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;lt;/tr&amp;gt; &lt;/p&gt;
&lt;p&gt; &amp;lt;tr&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td bgcolor=&amp;quot;#6699FF&amp;quot; align=&amp;quot;center&amp;quot; colspan=&amp;quot;9&amp;quot;&amp;gt;&amp;lt;font color=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&amp;lt;b&amp;gt;WEB SERVER : &amp;lt;% Response.Write UCase(strServer) %&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; &amp;lt;/tr&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;lt;tr&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Site ID&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Description&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Site Dir&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Log Dir&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;IP Address&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;TCP Port&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;SSL Port&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Status&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;lt;/tr&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;%&lt;/p&gt;
&lt;p&gt;'------- obtain Server Name -------&lt;/p&gt;
&lt;p&gt;DIM CRLF, TAB&lt;/p&gt;
&lt;p&gt;'DIM strServer&lt;/p&gt;
&lt;p&gt;DIM objWebService&lt;/p&gt;
&lt;p&gt;DIM objWebServerRoot&lt;/p&gt;
&lt;p&gt;TAB &amp;nbsp;= CHR( 9 )&lt;/p&gt;
&lt;p&gt;CRLF = CHR( 13 ) &amp;amp; CHR( 10 )&lt;/p&gt;
&lt;p&gt;'Response.Write &amp;quot;Enumerating websites on &amp;quot; &amp;amp; strServer &amp;amp; CRLF&lt;/p&gt;
&lt;p&gt;SET objWebService = GetObject( &amp;quot;IIS://&amp;quot; &amp;amp; strServer &amp;amp; &amp;quot;/W3SVC&amp;quot; )&lt;/p&gt;
&lt;p&gt;EnumWebSites objWebService&lt;/p&gt;
&lt;p&gt;SUB EnumWebSites( objWebService )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM objWebServer, strBindings&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR EACH objWebServer IN objWebService&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF objWebserver.Class = &amp;quot;IIsWebServer&amp;quot; THEN&lt;/p&gt;
&lt;p&gt;SET objWebServerRoot = getobject(objWebServer.adspath &amp;amp; &amp;quot;/root&amp;quot;)&lt;/p&gt;
&lt;p&gt;%&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;lt;tr&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write &amp;quot;W3SVC\&amp;quot; &amp;amp; (objWebserver.Name) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write (objWebServer.ServerComment) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write (objWebserverRoot.Path) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write (objWebServer.LogFileDirectory &amp;amp; &amp;quot;\W3SVC&amp;quot; &amp;amp; objWebserver.Name) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write (EnumIP (objWebServer.ServerBindings)) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write (EnumSrvPort (objWebServer.ServerBindings)) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write (EnumSrvPort (objWebServer.SecureBindings)) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;% Response.Write (State2Desc( objWebserver.ServerState )) %&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;%&lt;/p&gt;
&lt;p&gt;'------- Enumerate Bindings -------&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strBindings = EnumBindings( objWebServer.ServerBindings ) &amp;amp; _&lt;/p&gt;
&lt;p&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;EnumBindings( objWebServer.SecureBindings )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF NOT strBindings = &amp;quot;&amp;quot; THEN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END IF&lt;/p&gt;
&lt;p&gt;set objWebServerRoot=nothing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END SUB&lt;/p&gt;
&lt;p&gt;'------- Strip IP Bindings -------&lt;/p&gt;
&lt;p&gt;FUNCTION EnumIP( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM x, strIP &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM reBinding, reMatch, reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SET reBinding = NEW RegExp&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;reBinding.Pattern = &amp;quot;([^:]*):([^:]*):(.*)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR x = LBOUND( objBindingList ) TO UBOUND( objBindingList)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SET reMatches = reBinding.Execute( objBindingList( x ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FOR EACH reMatch IN reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strIP = reMatch.SubMatches( 0 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strIP = &amp;quot;&amp;quot; THEN strIP = &amp;quot;All Unassigned&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF LEN( strIP ) &amp;lt; 8 THEN strIP = strIP &amp;amp; TAB&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumIP = EnumIP &amp;amp; strIP&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumIP = EnumIP &amp;amp; CRLF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;'------- Strip PORT Bindings -------&lt;/p&gt;
&lt;p&gt;FUNCTION EnumSrvPort( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM y, strPort&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM reBinding, reMatch, reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SET reBinding = NEW RegExp&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;reBinding.Pattern = &amp;quot;([^:]*):([^:]*):(.*)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR y = LBOUND( objBindingList ) TO UBOUND( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SET reMatches = reBinding.Execute( objBindingList( y ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FOR EACH reMatch IN reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPort = reMatch.SubMatches( 1 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strPort = &amp;quot;&amp;quot; THEN strPort = &amp;quot;*&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumSrvPort = EnumSrvPort &amp;amp; strPort&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumSrvPort = EnumSrvPort &amp;amp; CRLF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;'------- Strip HOST Bindings -------&lt;/p&gt;
&lt;p&gt;FUNCTION EnumBindings( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM z, strIP, strPORT, strHost&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DIM reBinding, reMatch, reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SET reBinding = NEW RegExp&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;reBinding.Pattern = &amp;quot;([^:]*):([^:]*):(.*)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR z = LBOUND( objBindingList ) TO UBOUND( objBindingList )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' objBindingList( i ) is a string looking like IP:Port:Host&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SET reMatches = reBinding.Execute( objBindingList( z ) )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FOR EACH reMatch IN reMatches&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strIP = reMatch.SubMatches( 0 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strPort = reMatch.SubMatches( 1 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strHost = reMatch.SubMatches( 2 )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Do some pretty processing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strIP = &amp;quot;&amp;quot; THEN strIP = &amp;quot;All Unassigned&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF strHost = &amp;quot;&amp;quot; THEN strHost = &amp;quot;*&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF LEN( strIP ) &amp;lt; 8 THEN strIP = strIP &amp;amp; TAB&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumBindings = EnumBindings &amp;amp; _&lt;/p&gt;
&lt;p&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; strIP &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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; strPort &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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; strHost &amp;amp; TAB &amp;amp; _&lt;/p&gt;
&lt;p&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;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnumBindings = EnumBindings &amp;amp; CRLF&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;NEXT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;'------- DEFINE IIS STATUS -------&lt;/p&gt;
&lt;p&gt;FUNCTION State2Desc( nState )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SELECT CASE nState&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Starting&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 2&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Started&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 3&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopping&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 4&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Stopped&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 5&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Pausing&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 6&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Paused&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE 7&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Continuing&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;CASE ELSE&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;State2Desc = &amp;quot;Unknown state&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;END SELECT&lt;/p&gt;
&lt;p&gt;END FUNCTION&lt;/p&gt;
&lt;p&gt;%&amp;gt;&lt;/p&gt;
&lt;p&gt;-- End of Code --&lt;/p&gt;
</description></item><item><title>re: HOWTO: Enumerate IIS website configuration (VBScript using ADSI)</title><link>http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO-Enumerate-IIS-Website-Configuration.aspx#9923069</link><pubDate>Mon, 16 Nov 2009 18:19:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9923069</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Wow, talk about doing things the hard way. &amp;nbsp;A few tips, David (if you haven't figured these out in the past four years):&lt;/p&gt;
&lt;p&gt;vbTab is a VB constant - you don't need TAB&lt;/p&gt;
&lt;p&gt;vbCrLf is a VB constant - you don't need CRLF&lt;/p&gt;
&lt;p&gt;If Not strBindings = &amp;quot;&amp;quot; Then &amp;nbsp; ... is easier said: If strBindings &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;/p&gt;
&lt;p&gt;That reBinding regular expression isn't needed.. try Split(objBindingList(i),&amp;quot;:&amp;quot;) ... results in an array as well but more efficient and less confusing&lt;/p&gt;
&lt;p&gt;Adding &amp;amp; &amp;quot;&amp;quot; to the end of the EnumBindings = EnumBindings.. statement is pointless&lt;/p&gt;
&lt;p&gt;Otherwise, nice job on a working prototype.&lt;/p&gt;
</description></item></channel></rss>