I'm trying to understand the SharePoint hierarchy of objects and don't understand SPWebService .

Here is what I have:

  • SPFarm contains
    • One or (usually) multiple WebApplications, each contains
      • One or more SPSites which then contain one or more SPWebs

I know that each SPWebApplication can have one or more SPContentDatabases and that SPSite is really a child of a Content Database which is really a child of SPWebApplication.

It looks like the SPWebService sits between SPFarm and SPWebApplication, but I don't understand if there is always just one or if there can be multiple SPWebServices? And under what circumstances would someone have more that one SPWebService?

1 Answer 1


The SPWebService is a container for the SPWebApplications.

For instance You can use the SPWebService.ContentService static property to return the SPWebService object which contains all content web applications (the SPWebService.AdministrationService can be used to get the web app for CA).

  • Ah great, that solves another issue that I had, "how to get the Farm Admin Site?". Do you know if there can ever be more than 1 SPWebService in a Farm? Commented Jun 14, 2010 at 2:46

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.