Apply Theme

Posted on 15 CommentsPosted in SharePoint 2007, STSADM Commands

This command came about as a result of wanting to be able to reset the theme of a web site when it was upgraded. I had created this code as part of the upgrade2 command and figured that I might as well pull it out into its own command so that it could be used independently of the upgrade command. I called this command gl-applytheme. Setting the theme is really simple – you just call […]

Move a Site Collection

Posted on 15 CommentsPosted in SharePoint 2007, STSADM Commands

As part of the upgrade I was working on we wanted to move site collections from the upgraded location to a new location on a different web application. This can be done really easily using the backup and restore built-in commands in conjunction with the deletesite command. But I wanted to make this work in one step with the upgrade so I decided to extend the upgrade2 command to enable the moving of sites. I […]

Set Audit Settings for Site Collection

Posted on 12 CommentsPosted in SharePoint 2007, STSADM Commands

In any financial institution auditing is crucial – it’s no different with my company – as such we wanted to make sure that there was at least a minimum level of auditing occurring at the site collection level. From the site collection settings page you can get to the "Site collection audit settings" page where some basic auditing can be enabled. For more complex stuff you can setup custom policies and associate them at various […]

Set Search Center

Posted on 4 CommentsPosted in SharePoint 2007, STSADM Commands

This was a pretty simple command to create and only took me a few minutes. Basically I needed to be able to set the search center for a site collection. You can do this via the browser by going to http://[portal]/[site collection]/_layouts/enhancedSearch.aspx.  The command I created is called gl-setsearchcenter. The code for this is beyond simple – it was just a matter of setting a string based property via the AllProperties collection: 1: string url […]

A Better Import

Posted on 26 CommentsPosted in SharePoint 2007, STSADM Commands

Some people may have read my post from a few days ago regarding the retargetting of the content query web part which was necessary because I had to move a sub-site from one site collection to another. In order to do the move I used the built-in import command. The problem that I sought to address with the retargetting of the content query web part was the result of the import creating new object identifiers […]

Set Local Site Directory

Posted on 4 CommentsPosted in SharePoint 2007, STSADM Commands

Way back one of the first commands I created was one which would allow you to set the Master Site Directory (gl-setmastersitedirectory). It turns out that because my company decided to have each division in it’s own site collection that I also needed to be able to set the local site directory (http://[host]/_layouts/SiteDirectorySettings.aspx). This one took me a minute to figure out what was involved as the disassembled code was a bit of a mess. […]

Add Site Administrator

Posted on 28 CommentsPosted in SharePoint 2007, STSADM Commands

Have you ever found yourself in a situation where you are the Farm administrator and you need to add a user (perhaps yourself) as a site collection administrator but you don’t want to be the site collection owner because you need a business user for that, you just want to be added as a site collection administrator? Well, if you’ve tried to use the stsadm command adduser or tried to use the browser to add […]

Set Site General Settings

Posted on 5 CommentsPosted 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 […]

Move Web

Posted on 52 CommentsPosted in SharePoint 2007, STSADM Commands

As part of my upgrade I’ve got several hundred web sites that need to be moved around (either from one web application to another or just to a different location with the same web app or site collection). I figured that I needed an easy way to do this – the usual way is to either use the browser and go to the content and structure page to move webs around within a site collection […]

Convert a Sub-site to a Site Collection

Posted on 254 CommentsPosted in SharePoint 2007, STSADM Commands

I finally figured it out! This was supposed to be one of those very simple tasks that I should have been able to do without any custom code. Turning a sub-site (or web) into a site collection (or top level site) turned out to be the most difficult task I’ve yet to face with SharePoint 2007. In theory you should be able to do this using the following commands which could be put into a […]