<?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: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx</link><description>Question: I need to audit web servers in my domain, and would like to be able to connect to each server, and enumerate the virtual directories -- ultimately leading to a link to each web site hosted by the server. Can this code be modified to get that</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#7494068</link><pubDate>Wed, 06 Feb 2008 19:59:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7494068</guid><dc:creator>Deathtospam</dc:creator><description>&lt;p&gt;David --&lt;/p&gt;
&lt;p&gt;I'm not sure how to get this script to work. &amp;nbsp;I've saved all of the blue code in a file called &amp;quot;enumvdirs.vbs&amp;quot;, but when I try to call &amp;quot;enumvdirs -?&amp;quot; from a command prompt (Windows XP), it crashes with a VBScript error (invalid character on line 1). &amp;nbsp;What am I doing wrong?&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#7572847</link><pubDate>Sun, 10 Feb 2008 03:02:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7572847</guid><dc:creator>John</dc:creator><description>&lt;p&gt;@Deathtospam&lt;/p&gt;
&lt;p&gt;It's not actually a VBScript. It's a DOS batch file. Save it as &amp;quot;enumvdirs.bat&amp;quot;&lt;/p&gt;
&lt;p&gt;Worked great for me. Thanks David.&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#8209540</link><pubDate>Fri, 14 Mar 2008 22:42:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8209540</guid><dc:creator>Makhan</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;Thanks for that script, but could you please describe the below loop that you are implementing. I dint get the logic entirely. I have used the script though :D&lt;/p&gt;
&lt;p&gt;FOR /F %%A IN ( %SERVERS% ) DO (&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;FOR /F &amp;quot;usebackq skip=1 tokens=*&amp;quot; %%I IN ( `%CMD_ADSUTIL% FIND %PROPERTY_TO_FIND% -s:%%A` ) DO (&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FOR /F &amp;quot;usebackq tokens=3,*&amp;quot; %%J IN ( `%CMD_ADSUTIL% GET %%I/%PROPERTY_TO_FIND% -s:%%A` ) DO (&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ECHO %%A/%%I = %%K&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;)&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#8308000</link><pubDate>Tue, 18 Mar 2008 10:08:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8308000</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Makhan - what part are you having trouble understanding?&lt;/p&gt;
&lt;p&gt;It is standard FOR /F &amp;nbsp;logic -- please see the output of FOR /? for the actual syntax to determine what is going on.&lt;/p&gt;
&lt;p&gt;The quickest translation of the logic is:&lt;/p&gt;
&lt;p&gt;For each servername from each line in the filename %SERVERS%&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Use adsutil to look for all instances of the property &amp;quot;Path&amp;quot; on the server and parse out the metabase path&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Retrieve the value of the metabase path and print it out&lt;/p&gt;
&lt;p&gt;The entire magic is based on the premise that the Path metabase property determines a virtual directory mapping. Thus, when you list out all values of that property, you are listing out all virtual directories and their associated path.&lt;/p&gt;
&lt;p&gt;I then added &amp;quot;how to scale an operation over a list of servers&amp;quot; just to illustrate how easy it is to scale an operation with simple, proper tools.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#8439351</link><pubDate>Wed, 30 Apr 2008 00:11:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8439351</guid><dc:creator>Junu</dc:creator><description>&lt;p&gt;How can we include URLs also in the output?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Junu&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#8443258</link><pubDate>Wed, 30 Apr 2008 16:00:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8443258</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Junu - what do you mean by &amp;quot;URL&amp;quot; ?&lt;/p&gt;
&lt;p&gt;The output already includes the URL on the left hand side and the physical path on the right hand side.&lt;/p&gt;
&lt;p&gt;If you want W3SVC/1/ROOT to resolve to something else, use this script to enumerate the websites and associated host headers.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO_Enumerate_IIS_Website_Configuration.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2005/07/13/HOWTO_Enumerate_IIS_Website_Configuration.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#8572018</link><pubDate>Tue, 03 Jun 2008 22:28:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8572018</guid><dc:creator>Jas</dc:creator><description>&lt;p&gt;Hello David, &lt;/p&gt;
&lt;p&gt;Nice Article.&lt;/p&gt;
&lt;p&gt;Is there way to detect if website has been stopped.&lt;/p&gt;
&lt;p&gt;Becuase we have aspx applciation with background threads.&lt;/p&gt;
&lt;p&gt;Applcaition does not shutdown properly if someone expilicitly stop the website.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Jas&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#8627269</link><pubDate>Sat, 21 Jun 2008 00:15:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8627269</guid><dc:creator>Junu</dc:creator><description>&lt;p&gt;CScript C:\WINDOWS\system32\iisweb.vbs /query&lt;/p&gt;
&lt;p&gt;The above command will display all website and its status. &amp;nbsp;But I dont know how to include Virtual Directories also in that output. &amp;nbsp; Any idea?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Junu.&lt;/p&gt;
</description></item><item><title>re: HOWTO: List all Virtual Directories and Paths of a List of Servers</title><link>http://blogs.msdn.com/david.wang/archive/2007/12/19/howto-list-all-virtual-directories-and-paths-of-a-list-of-servers.aspx#9064976</link><pubDate>Thu, 13 Nov 2008 04:49:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9064976</guid><dc:creator>JCollum</dc:creator><description>&lt;p&gt;Thanks man, this saved me a ton of time today. &lt;/p&gt;
</description></item></channel></rss>