« Previous Next »

Thread: Create Host Header

Last post 12-08-2008 2:16 PM by marcoshaw. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 12-03-2008, 10:30 PM

    • ldadams
    • Not Ranked
    • Joined on 09-08-2004, 3:34 PM
    • Posts 1

    Create Host Header

    How might I script creating host headers for a website in iis7.  I could provide a xml or csv file of entries.  I am very fimiliar with c# just havent used powershell before.

    Thanks

  • 12-08-2008, 2:16 PM In reply to

    Re: Create Host Header

    Very helpful: http://blogs.iis.net/jeonghwan/archive/2008/07/30/iis-powershell-user-guide-comparing-representative-iis-ui-tasks.aspx

    Check section 17, case 2:
    new-webbinding -site foo -ipaddress * -port 80 -hostheader bar

    If you create a iis.csv file like this:
    site,port,ipaddress,hostheader
    "default web site",80,"*","abc"
    "default web site",80,"*","def"

    You can simply do:
    import-csv iis.csv|new-webbinding

    That's it!

    [Update: Now, this is assuming you're considering using the new IIS PowerShell snap-in.  It is still in a preview state.]

Page 1 of 1 (2 items)
Microsoft Communities