Metabase Backup Enumerator

Overview

It's often nice to have several different versions of your metabase backed up, especially if you're making a lot of changes to your metabase (or practicing writing admin tools). This sample admin tool, if invoked without any command-line arguments, lists all available backup location sets. If an argument is present on the command-line, the tool assumes that it is the name of a backup location, and will list only those versions that match that location.

Code Tour

The method that accomplishes this location list, EnumBackups, is not as straightforward as the other backup methods. EnumBackups, behind-the-scenes, sees the list of backups as an array, but it does not return that array to your script. Instead, the method takes several parameters. A name parameter is passed to the method, specifying what backup sets the method is to retrieve. If no name is supplied, all the backup sets available to IIS are returned as a result. Several return variables are supplied to EnumBackups, to hold the name, version, and date information for each individual backup set. Finally, an index into the (behind-the-scenes) array is passed to EnumBackups, specifying from which element of the result array the name, version, and date information should be drawn. For this sample, EnumBackups is executed in a loop until the index into the result array is out of range and an error is generated.

Location

This script is available in the IIS samples directory, at ...\admin\metabackenum.vbs.