Welcome to the "GatWeb - Extensions for Stsadm" project

This project aims to add new operations for the stsadm.exe utility for SharePoint 2007. Microsoft makes this tool extensible, so developers can add easily new functionnalities.

Stsadm is a good way to script actions against SharePoint like backup of site collections or to help SharePoint administrators manage their platform.

Please do not install in production without first testing, and validating your own ability to support this code as this is provided "as is."

Support will be on an as is, please use the "Issue Tracker" to add bugs reports, and also the discussion board as a wish list for new features or general questions about these extensions.

Pre requisites

You must have :
  • .NET Framework 3.0
  • Windows SharePoint Services 3.0 (WSS 3.0) or Microsoft Office SharePoint Server 2007 (MOSS 2007)

It must be run on a SharePoint server.

How to use stsadm

stsadm -o (operation name) [-argumentname argumentvalue]

Arguments between [ and ] are optional.
You can get help message using "stsadm -help (operation name)".

List of operations, arguments and description

  • backupwebapp : backup all sites collections of a specific web application
    • -url (url) : web application's url
    • -filename (filename) : backup's filename, backups are generated using an incremental counter added before the extension (backup.dat => backup0.dat, backup1.dat, ...). You can also use some special tags that will be replaced in the filename : %i replace with the incremental counter, %u replace with the relative server url ( "/" is replaced by "_" character ) and %d replace with the current date.
    • [-overwrite] : overwrite backup's files if they exist
    • [-generatexml] : generate an XML file with information about the backup operation (id, url, backup duration, ...)
  • getwebproperty : returns the value of a website's property
    • -url (url) : website's url
    • -propertyname (propertyname) : website's property name
  • setwebproperty : set a website's property
    • -url (url) : website's url
    • -propertyname (name) : website's property name
    • -propertyvalue (value) : website's property value
  • enumlistevents : enumerates all event receivers of a specific list
    • -url (url) : website's url
    • -listname (list name) : list name or id

How to install these extensions

These extensions are packaged in two ways :
  • a MSI package that should be installed on your SharePoint server. Simple "click/next" operation.
  • a SharePoint Solution package that should be added and deployed using stsadm. First add it to the configuration database using this command : "stsadm -o addsolution -filename GatWeb.SharePoint.CustomStsadm.wsp". Then deploy it using the central administration website / Operations / Solution Management. More information about solutions on MSDN.

The second way is the best, first because it's the good way to package and deploy SharePoint developments, and also because it installs files on all servers.
Theses packages install an XML file (stsadmcommands.gatweb.xml) into the "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG" (the path may vary depending on your Windows 2003 installation and language) and a dll (GatWeb.SharePoint.CustomStsadm.dll) into the Global Assembly Cache (GAC).

Source code

Source code is provided "as is" but can help you develop your own operation.
Source code is currently only available from the "Releases" section and will be available on the "Source code" section soon.

Future operations

I plan to add new operations when I get time and/or when I need them for my own use. You can also request new operation through the discussion board.

I currently working on three operations :
  • addlistevent : add an event receiver to a list
  • deletelistevent : delete an event receiver from a list
  • restorewebapp : restore one or all sites' collections using the generated XML file of "backupwebapp" operation

Governance & manageability

Look at this project managed by Joel Oleson on Codeplex for others tools and articles :
http://www.codeplex.com/governance

About the author

SharePoint Inspector is written by Gaetan Bouveret. He currently works at Winwise http://www.winwise.fr a french Microsoft Gold Partner.

My CodePlex projects

SharePoint Inspector : SharePoint Inspector is a free tool to browse your SharePoint 2007 farm (objects like web applications, sites collections, sites, lists, ...)
SharePoint Events Manager : This simple feature enables management of events on lists and document libraries through a new item on list settings menu

Last edited Jun 21, 2007 at 8:37 AM by GatWeb, version 14