Set Site General Settings

Posted on Posted in SharePoint 2007, STSADM Commands

This command, gl-setsitegeneralsettings, is the replacement command for the gl-setsitecollectiontitle command. It’s basically just that command renamed and reworked to make it much more capable. The original command only allowed you to set the title of a site collection – this was just way to limiting so I changed it so that you could also set the description and the logo and this can now be done to any site, not just the top level site collection.

In most cases you’re going to want to use master pages to set the look and feel so I don’t see this as being too useful but I just couldn’t leave the old command as it was (sorry to anyone who had that command as part of a script but I think you’ll find this one much better). One of the nice changes I made was the ability to recurse the logo changes to all sub webs. To take this further, if you don’t actually provide a logo and alt text to the command but you do provided the recurse switch then it will recurse the settings for the specified site down to all children sites. I could see something like this being put into a timer job to help keep all sub-sites with the same logo.

The syntax of the command can be seen below:

C:\>stsadm -help gl-setsitegeneralsettings

stsadm -o gl-setsitegeneralsettings

Sets the general properties of a site.

        -url <site url>
        [-title <site title>]
        [-description <description for the site>]
        [-logourl <site logo url>]
        [-logoalttext <alternative text for logo>]
        [-recurselogochanges (recurse logo changes to all sub-sites)]

Here’s an example of how to set all the general properties and recurse the logo changes down to all sub-sites:

stsadm –o gl-setsitegeneralsettings –url "http://intranet/" –title "Corporate Portal" -description "Edfinancial Services Corporate Portal" -logourl "/_layouts/images/edfinancial.gif" -logoalttext "Edfinancial Services Logo" -recurselogochanges

Here’s another example showing how to recurse all logo changes from the specified site using whatever is set at that site rather than specifying it explicitly:

stsadm –o gl-setsitegeneralsettings –url "http://intranet/" -recurselogochanges

5 thoughts on “Set Site General Settings

  1. Not really sure why it would behave like that. Might be an AAM issue. I’d have to look into how the SPSite object is loading up – you might try a simple thing like making sure there’s a trailing slash (/) or see if it behaves the same when using a sub-site.

  2. Wow. This just saved a couple of hours of work this morning. I thought the stsadm gl tools might let me write a script to recursively set the site logo, but I had no idea it was baked right in! Thanks!

  3. Hi Gary, thanks for all the tools, they’ve been a great help. I am experiencing a small isse and I’m not quite sure why, but using this in a .cmd file replaces “-url” with “ûurl” (Replacing – with U+00FB). No issue when typing in a command prompt.

    stsadm -o gl-setsitegeneralsettings ûurl “” -logourl “/_layouts/images/CustomIMG/mylogo.gif” -logoalttext “My Logo” -recurselogochanges

    Any ideas?

Comments are closed.