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 (38) -

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

  • DEBORA Laurence

    11/12/2014 4:07:04 PM |

    Forum Annuaires-gratuit.com, annuaire de sites web et moteur de recherche sur annuaires-gratuit.com/annuaires/ .

  • DEBORA Laurence

    11/12/2014 4:22:07 PM |

    Forum Annuaires-gratuit.com, annuaire de sites web et moteur de recherche sur annuaires-gratuit.com/annuaires/ .

  • DEBORA Laurence

    11/12/2014 5:01:30 PM |

    Forum Annuaires-gratuit.com, annuaire de sites web et moteur de recherche sur annuaires-gratuit.com/annuaires/ .

  • Lynna Kazanjian

    12/7/2014 5:18:32 PM |

    I enjoy you because of all of your hard work on this website. My aunt really loves setting aside time for investigation and it is simple to grasp why. We all learn all about the dynamic ways you produce helpful steps by means of your blog and even recommend participation from other people on this article and our own child is always learning a great deal. Enjoy the rest of the new year. You are doing a wonderful job.

  • Joesph Jody

    12/7/2014 8:24:53 PM |

    Real wonderful info  can be found on site.

  • idlife

    12/8/2014 7:48:49 PM |

    Nice post! Check out my site sometime!

  • Mental Health Social Network

    12/15/2014 3:33:20 PM |

    Hello, nice post!

  • container huren

    1/3/2015 4:50:08 PM |

    Normaal gesproken gooien we afval in een afvalcontainer. Deze kan je kopen, krijg je soms van de gemeente of je kan een <a href=”http://www.123afvalcontainer.nl”>afvalcontainers huur</a>

  • container online

    1/8/2015 7:18:24 PM |


  • pil

    1/16/2015 6:23:10 PM |


  • casino

    1/19/2015 4:59:40 PM |


  • casino

    1/19/2015 6:21:46 PM |


  • http://fiverr.com/eebest8

    1/29/2015 6:11:19 PM |

    Thanks-a-mundo for the article.Really thank you! Will read on...

  • inflatable tunnels

    2/5/2015 9:19:28 PM |

    Muchos Gracias for your blog.Really looking forward to read more. Great.

  • life ionizer review

    2/7/2015 12:12:01 PM |

    I think this is a real great blog post. Awesome.

  • п»їOur Muay Thai

    2/9/2015 4:36:55 AM |

    Very neat blog post.Really looking forward to read more. Will read on...

  • domain appraisal

    2/17/2015 6:28:07 PM |

    Thanks-a-mundo for the post. Great.

  • cheap hotel in Patong

    2/18/2015 9:46:33 AM |

    I really enjoy the article. Much obliged.

  • water ionizers

    2/20/2015 11:00:32 AM |

    Say, you got a nice blog.Much thanks again. Much obliged.

  • Mary Lovers

    2/28/2015 3:54:28 PM |

    Some truly quality posts on this site, saved to favorites.

  • do it yourself divorce

    3/2/2015 1:05:34 AM |

    I loved your blog article. Cool.

  • Taable

    3/2/2015 12:14:45 PM |

    Really enjoyed this blog article.Really thank you!

  • bulk sms company

    3/3/2015 9:10:07 AM |

    Im obliged for the article post.Really looking forward to read more. Awesome.

  • My Website

    3/15/2015 10:12:03 AM |

    A big thank you for your article post.Really thank you! Fantastic.

  • Gary Lazeo

    3/17/2015 1:26:17 PM |

    I appreciate you sharing this blog.

  • rental mobil surabaya

    3/17/2015 4:55:12 PM |

    Wow, great blog post.Much thanks again. Fantastic.

  • Darren Hobbs

    4/14/2015 11:39:35 PM |

    thank you for sharing  , but the thing is i dont know how to implement this code. do you have some tut or video about implementation ?


  • hot girl sex

    6/3/2015 6:30:10 PM |

    Very neat blog article. Cool.

  • sex party

    6/26/2015 2:15:41 PM |

    I think this is a real great post. Great.

  • young ebony

    7/22/2015 1:59:30 AM |

    Thanks a lot for the blog post.Really thank you!