2

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

2 Answers 2

4

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.

-4

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:

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

1
  • 3
    This code uses the Server Object Model, not the Client Object Model Commented Aug 17, 2013 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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