views:

119

answers:

3

Hi

I was able to retrieve all the web application names within a farm using object model. But I could not find a way to display all the web application URLs within a farm.

Can some one help me with this?

Thanks

Carol

+1  A: 

The webapplication urls are bound to the Zones used by the webapplication (i.e. the Default, Internet and Intranet zones), find them using the SPWebApplication.AlternateUrls property. (msdn)

Colin
Hi ColinThanks for the response. It helped me alot.ThanksCarol
Carol
A: 

I take it you probably really want all site collection URLs on all web applications. Here's a short powershell script I wrote - you should be able to infer the C# OM from this:

[reflection.assembly]::loadwithpartialname("microsoft.sharepoint") > $null

[Microsoft.SharePoint.Administration.SPFarm]::local.services | `
    where-object {$_ -is [Microsoft.SharePoint.Administration.SPWebService] } | `
    select -expand webapplications | select -expand sites | `
    select url, zone, owner, rootweb | format-table -auto

Hope this helps,

-Oisin

x0n
I just want to populate all the Web Application URLs using WSS object model.
Carol
A: 

Hi

I got it solved. Refer the link below:

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/ede30d20-d471-4722-8f3a-cf00f58cbfb0

Thanks

Carol

Carol

related questions