« Previous Next »

Thread: list all bindings for a site (customised return parameters)

Last post 10-05-2009 10:56 AM by rkr31. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-02-2009, 2:39 PM

    • rkr31
    • Top 200 Contributor
    • Joined on 05-01-2007, 6:15 AM
    • Posts 30

    list all bindings for a site (customised return parameters)

     Hi

     

    now i know that i can use Get-ItemProperty IIS:\Sites\win1005 -Name bindings to list the bindings for a particular site, but i need to pass the parameters back to another script so need to output parameters to be different.  The above command returns:

    Collection
    ----------
    {http *:80:win1005site.com, http *:80:www.rrrr.com}

    I need to return 

    win1005site.com, www.rrrr.com

     

    Any ideas how i can achieve this?

     Thanks

    Richard

  • 10-04-2009, 12:32 PM In reply to

    Re: list all bindings for a site (customised return parameters)

    I don't have a good test environment setup right now.

    Try something like this maybe:

    PS>Get-ItemProperty your_path -name bindings|foreach{$_.collection}|foreach{$_.bindingInformation.split(":")[2]}

  • 10-05-2009, 10:56 AM In reply to

    • rkr31
    • Top 200 Contributor
    • Joined on 05-01-2007, 6:15 AM
    • Posts 30

    Re: list all bindings for a site (customised return parameters)

     Thats great.  Works a charm.  Just one thing (and i really am simply being picky here) but are we able to have all values on the same line seperated by commas?

Page 1 of 1 (3 items)
Microsoft Communities