<?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: Help needed with script!</title><link>http://forums.iis.net/thread/1900468.aspx</link><pubDate>Tue, 14 Apr 2009 15:32:53 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1900468</guid><dc:creator>Bob Landau</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1900468.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1151&amp;PostID=1900468</wfw:commentRss><description>&lt;p&gt;fyi &lt;/p&gt;
&lt;p&gt;&amp;nbsp;New-WebSite -Name Web1 -Id 2 -ApplicationPool AppPool1 -PhysicalPath c:\temp\web1&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;is an easier way to do what your up to.&lt;/p&gt;
&lt;p&gt;Having said that it is nice knowing what this cmdlet is up to. I&amp;#39;ve never bothered looking into the WebAdmin object model; now I&amp;#39;m curious&lt;/p&gt;
&lt;p&gt;&amp;nbsp;bob&lt;/p&gt;</description></item><item><title>Re: Help needed with script!</title><link>http://forums.iis.net/thread/1900418.aspx</link><pubDate>Tue, 14 Apr 2009 09:24:28 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1900418</guid><dc:creator>Dazevo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1900418.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1151&amp;PostID=1900418</wfw:commentRss><description>&lt;p&gt;Never mind, it&amp;#39;s done.&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, 8080)&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;New-WebBinding -Name $Name -Port 80 -IPAddress $ip -HostHeader $hostheader&lt;/p&gt;</description></item><item><title>Help needed with script!</title><link>http://forums.iis.net/thread/1900402.aspx</link><pubDate>Tue, 14 Apr 2009 07:10:36 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1900402</guid><dc:creator>Dazevo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1900402.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1151&amp;PostID=1900402</wfw:commentRss><description>&lt;p&gt;Hello, I&amp;#39;m new in the programjming world and I have a script to create a site and application in IIS. This is it:&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;&amp;nbsp;[String]$Path=&amp;quot;c:\inetpub\wwwroot&amp;quot;,&amp;nbsp;&amp;nbsp;&amp;nbsp; #The Physical Path of the site&lt;br /&gt;&amp;nbsp;[String]$AppPool=&amp;quot;MyPool&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\sitemanager&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;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;[String]$Name=(&amp;quot;{0} {1}&amp;quot; -f $Customername,$ProjectName)&lt;br /&gt;&amp;nbsp;&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, 8080)&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;&amp;nbsp;Now I want to add something to the script so that the site gets an ip address and a URL. So I want to have the parameters URL and IP. Is this possible to add? Can someone add this to my script? Thank you!&lt;/p&gt;</description></item></channel></rss>