« Previous Next »

Thread: Script request.

Last post 04-08-2009 9:57 AM by Dazevo. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 04-08-2009, 5:09 AM

    • Dazevo
    • Not Ranked
    • Joined on 04-06-2009, 5:35 AM
    • Posts 8

    Script request.

    Never mind
  • 04-08-2009, 9:57 AM In reply to

    • Dazevo
    • Not Ranked
    • Joined on 04-06-2009, 5:35 AM
    • Posts 8

    Re: Script request.

    Update:

     I got this now.


    Param
    (
     [String]$Name,    #The Name of the site
     [String]$Path="c:\inetpub\wwwroot",    #The Physical Path of the site
     [String]$AppPool="My Default Application Pool",  #The name of the appPool the default app is part of
     [Int]$SiteID

    )
     
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
    $iis = new-object Microsoft.Web.Administration.ServerManager
    #$Site = $iis.Sites.Add($Name, $Path, 8080)
    #$Site.ServerAutoStart = $true
    $Site = $iis.Sites.CreateElement()
    $Site.ID = $SiteID
    $Site.Name = $Name
    $Site.Applications.Add("/", $Path)
    $Site.Applications["/"].ApplicationPoolName = $AppPool
    $iis.Sites.Add($Site)
    $iis.CommitChanges()

    $objIIS = new-object System.DirectoryServices.DirectoryEntry("C:\test\test")
    $objIIS | get-member("NewFolder","C:\test")

Page 1 of 1 (2 items)
Microsoft Communities