<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS 7.0  - PowerShell</title><link>http://forums.iis.net/1151.aspx</link><description>All about IIS 7.0 PowerShell integration. Use this forum to ask PowerShell questions, discuss issues, request features and yell at IIS team members.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: PowerShell IIS 6.0???</title><link>http://forums.iis.net/thread/1903821.aspx</link><pubDate>Fri, 15 May 2009 05:04:38 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1903821</guid><dc:creator>sergeia</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1903821.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1151&amp;PostID=1903821</wfw:commentRss><description>&lt;p&gt;Well, this is not a Powershell snapin. It is Microsoft.Web.Administration library in use, which unfortunately doesn&amp;#39;t work with IIS6 either. Both these tools are based on IIS7 configuration, and IIS6 configuration is quite different.&lt;/p&gt;
&lt;p&gt;I would recomment you to access IIS6 metabase from PowerShell using either old WMI provider (&amp;quot;Microsoftiisv2&amp;quot;) or ADSI provider. Both are accessible from PowerShell. If you are suing it on IIS7 make sure you installed &amp;quot;IIS6 Management Compatibilty&amp;quot; components. In this case I would recommend to abandon IIS6 and switch to IIS7 APIs, you will have to do it sooner or later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;--Sergei&lt;/p&gt;</description></item><item><title>Re: PowerShell IIS 6.0???</title><link>http://forums.iis.net/thread/1900445.aspx</link><pubDate>Tue, 14 Apr 2009 13:45:03 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1900445</guid><dc:creator>ma_khan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1900445.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1151&amp;PostID=1900445</wfw:commentRss><description>&lt;p&gt;As fas as I know IIS PowerShell Snap-in does not work with IIS 6.... &lt;/p&gt;</description></item><item><title>PowerShell IIS 6.0???</title><link>http://forums.iis.net/thread/1900435.aspx</link><pubDate>Tue, 14 Apr 2009 12:39:56 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1900435</guid><dc:creator>Dazevo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1900435.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1151&amp;PostID=1900435</wfw:commentRss><description>&lt;p&gt;Is there anyway to edit this script to work with IIS 6.0 in Windows server 2003?&lt;/p&gt;
&lt;p&gt;This is my final script. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Param&lt;br /&gt;( [String] $Customername = $(Throw &amp;quot;You must enter a customer name&amp;quot;),&lt;br /&gt;[String] $Projectname = $(Throw &amp;quot;You must enter a project name&amp;quot;),&lt;br /&gt;[String]$Path=&amp;quot;c:\inetpub\wwwroot\$Customername\$Projectname\website\wwwroot&amp;quot;,&amp;nbsp;&amp;nbsp;&amp;nbsp; #The Physical Path of the site&lt;br /&gt;&amp;nbsp;[String]$AppPool=&amp;quot;DefaultAppPool&amp;quot;,&amp;nbsp; #The name of the appPool the default app is part of&lt;br /&gt;&amp;nbsp;[Int]$SiteID = $(Throw &amp;quot;You must enter a site id number&amp;quot;),&lt;br /&gt;&amp;nbsp;[String]$PhysicalPath=&amp;quot;c:\inetpub\wwwroot\$Customername\$Projectname\website\wwwroot&amp;quot;, &amp;nbsp;&amp;nbsp;#The Applications Physical Path&lt;br /&gt;&amp;nbsp;[String]$RelativePath=&amp;quot;/sitemanager&amp;quot;,&amp;nbsp;&amp;nbsp;#The Applications Relative Path&lt;br /&gt;&amp;nbsp;[string]$ip = $(Throw &amp;quot;You must enter an ip&amp;quot;),&amp;nbsp;&lt;br /&gt;&amp;nbsp;[string]$hostheader = $(Throw &amp;quot;You must enter an ip&amp;quot;)&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;mkdir &amp;quot;C:\inetpub\wwwroot\$customername\$projectname\website\wwwroot&amp;quot;&lt;br /&gt;mkdir &amp;quot;C:\inetpub\wwwroot\$customername\$projectname\website\sitemanager&amp;quot;&lt;/p&gt;
&lt;p&gt;[String]$Name=(&amp;quot;{0} {1}&amp;quot; -f $Customername,$ProjectName)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;[System.Reflection.Assembly]::LoadWithPartialName(&amp;quot;Microsoft.Web.Administration&amp;quot;)&lt;br /&gt;$iis = new-object Microsoft.Web.Administration.ServerManager&lt;br /&gt;$Site = $iis.Sites.Add($Name, $Path, 80)&lt;br /&gt;$Site.ServerAutoStart = $true&lt;br /&gt;$Site = $iis.Sites.CreateElement()&lt;br /&gt;$Site.ID = $SiteID&lt;br /&gt;$Site.Name = $Name&lt;br /&gt;$Site.Applications.Add(&amp;quot;/&amp;quot;, $Path)&lt;br /&gt;$Site.Applications[&amp;quot;/&amp;quot;].ApplicationPoolName = $AppPool&lt;br /&gt;#$iis.Sites.Add($Site)&lt;br /&gt;$iis.CommitChanges()&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;#Reference the Microsoft.Web.Administration namespace&lt;br /&gt;[System.Reflection.Assembly]::LoadWithPartialName(&amp;quot;Microsoft.Web.Administration&amp;quot;)&lt;br /&gt;$iis = new-object Microsoft.Web.Administration.ServerManager&lt;/p&gt;
&lt;p&gt;#Add the Application to the site&lt;br /&gt;$iis.Sites[$Name].Applications.Add($RelativePath, $PhysicalPath)&lt;br /&gt;$iis.CommitChanges()&lt;br /&gt;Write-Host $AppPool&lt;br /&gt;#Add the application to the appPool&lt;br /&gt;$iis.Sites[$Name].Applications[$RelativePath].ApplicationPoolName = $AppPool&lt;br /&gt;$iis.CommitChanges()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item></channel></rss>