To reconfigure our load balancing setup, we needed to have a list of all urls used 
in the farm. Since by using the SPSite's property 'url' didn't give use the 
hostheaders of the web application extends, I got them from the IISSettings property 
of the web application, which, according to MSDN, "Gets a collection of settings for 
all Internet Information Services (IIS) instances that belong to the Web application."

( )

[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c") | out-null 
| ForEach-Object{ $_.IisSettings } ` 
| ForEach-Object{ $_.values} ` 
| ForEach-Object{ $_.ServerBindings } ` 
| select HostHeader, Port

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s