Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How do I get url of all the web application created in SharePoint 2010 with client object model using C#.

share|improve this question

2 Answers 2

You can`t. The Client Object Model (CSOM) does not provide access above the Site Collection level.

As far as I know, the only way to do what you want is to create a custom web service that gets the Web Application information using the Server Object Model and have the remote application use it instead of the CSOM.

share|improve this answer

You can use below method to fetch all web applications:

    var service = SPFarm.Local.Services.GetValue<SPWebService>(string.Empty);
            foreach (SPWebApplication webApplication in service.WebApplications)
            {
                // using 'webApplication.Sites' you can get the result now.
            }

you can also refer below url:

http://stackoverflow.com/questions/11628349/get-the-all-infromation-of-sharepoint-server-using-client-object-model

share|improve this answer
1  
This code uses the Server Object Model, not the Client Object Model –  Rob Windsor Aug 17 '13 at 15:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.