SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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).

share|improve this answer
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? – Michael Stum Jun 14 '10 at 2:46

Your Answer


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.