Programmatically getting the Site Collection Name

Just was sorting out a quick console app that audited all the details of a MOSS 2007 farm, all Web Applications, down through Site Collections, Sites, Webs and down to list level.  When presenting this to the end user, I wanted to use a cascading drop down, where the user selected the Web Application and then had a nice list of Site Collections to choose from.

The problem I hit was how on earth to get the Site Collection Title and Description.  These are displayed in Central Administration | Application Management | Site Collection List but are not included in the SPSiteCollection object, nor the WebApplication object (which holds stuff like the Content Database which is included on that page).

Answer: the Title and Description that appears on the Site Collection List page is the Title and Description of the root Site in the Site Collection.

Try it!  Check the Title and Description in Central Admin, then change them on the root Site using Site Settings | Title, Description and Icon.

Took me a while to find that one…

Advertisements

Posted on October 22, 2012, in SharePoint and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: