James Mann's Blog

The blog of James Mann

Enumerate web applications on a sharepoint farm

To enumerate site collections on a farm:
SPWebService contentService = SPWebService.ContentService;

foreach(SPWebApplication app in contentService.WebApplications) 
  if (app.Sites.Count > 0) 
    // pick the first site (root site)
    SPSite rootSite = app.Sites[0];

Comments (4) -

  • Leonel Benton

    3/9/2013 4:26:16 PM |

    The following is without doubt one of the most interesting posts I have read in  a while.  I would really like to read and find out more about this.

  • Mabelle Best

    6/3/2013 11:07:55 AM |

    Amazingly I genuinely like this and I hope to run into some more listings similar to this.  Thanks your online contribution.

  • Electrician Directory

    7/20/2013 1:29:05 PM |

    This is very interesting, You're a very skilled blogger. I've joined your rss feed and look forward to seeking more of your great post. Also, I have shared your web site in my social networks!

    Also visit my weblog:  Electrician Directory - http://www.tradesmanwebdirectory.co.uk/

  • electricians

    8/28/2013 7:53:54 PM |

    Great blog here! Additionally your site loads up very fast! What web host are you the usage of? Can I get your associate hyperlink on your host? I desire my site loaded up as fast as yours lol

    my page ::  electricians - http://www.electrician2hire.co.uk

  • baju muslim wanita big size

    9/17/2013 3:51:39 PM |

    Hi, i think that i saw you visited my weblog thus i came to �return the favor�.I'm trying to find things to enhance my site!I suppose its ok to use a few of your ideas!!

  • Renita Cardenas

    10/11/2013 6:35:13 PM |

    This kind of post is certainly one of the best I have seen thus far.  I truly enjoyed reading this and I hope to hit upon further discussions that are equally appealing.

  • letters from Santa

    12/4/2013 1:59:27 PM |

    At this time it appears like Expression Engine is the top blogging platform out there right now. (from what I've read) Is that what you're using on your blog?

  • Chris Ausbrooks

    2/9/2014 10:29:44 AM |

    Informative Site… Hello guys here are some links that contains information that you may find useful yourselves. It’s Worth Checking out….

  • Devin Naputi

    4/27/2014 8:59:13 PM |

    I'll gear this review to 2 types of people: current Zune owners who are considering an upgrade, and people trying to decide between a Zune and an iPod. (There are other players worth considering out there, like the Sony Walkman X, but I hope this gives you enough info to make an informed decision of the Zune vs players other than the iPod line as well.)

  • DEBORA Laurence

    8/25/2014 8:34:18 AM |

    annuaires-gratuit.com/ vous propose de créer gratuitement un annuaire de sites internet pour un bon référencement.

  • punyadesain

    9/5/2014 11:29:54 PM |

    Artikel yang bermafaat Smile

  • Vince Rothove

    10/8/2014 9:37:40 AM |

    I hope you never stop! This is one of the best blogs I've ever read. You've got some mad skill here, man. I just hope that you don't lose your style because you're definitely one of the coolest bloggers out there. Please keep it up because the internet needs someone like you spreading the word.