find site with host header [Answered]RSS

3 replies

Last post Jun 27, 2011 06:01 AM by rkr31

  • find site with host header

    Jun 22, 2011 10:16 AM|rkr31|LINK

    Hi Im getting odd results looking for host headers. What i want to do is search all iis sites for a certain host header/binding and respond with the site name get-webbinding does not show me the site name get-website | where {$_.Bindings -eq "http *:80:win1014.domain.co.uk"} does not give me anything any ideas? Thanks Richard
  • Re: find site with host header

    Jun 24, 2011 02:28 AM|Lloydz|LINK

    Hi,

    The value of bindings is "Microsoft.IIs.PowerShell.Framework.ConfigurationElement", that's why the command return nothing with the filter. In this case, you can use following command instead:

    get-website | where {$_.bindings.collection -like "*http [*]:80:win1014.domain.co.uk*"}

    Thanks.

  • Re: find site with host header

    Jun 24, 2011 02:31 AM|Lloydz|LINK

    It seems the forum takes "[_*_]"(remove both "_") as a special character.

    The command is:

    get-website | where {$_.bindings.collection -like "*http [_*_]:80:win1014.domain.co.uk*"} (remove the "_" in "[_*_]")

    Thanks.

     

  • Re: find site with host header

    Jun 27, 2011 06:01 AM|rkr31|LINK

    Awesome. Thanks