This is a command line tool, that will show all the sites on a MOSS server.
Its output is suitable for pairing it with grep or another one of your favourite unix like string handeling tools.
You can get it here, and the source here
Code below:
static void Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine("Usage: ShowAllSites <url> ");
return;
}
string url = args[0];
SPSite site = new SPSite(url);
SPWebCollection col = site.AllWebs;
string[] urls = col.Names;
foreach (string siteUrl in urls)
{
Console.WriteLine(siteUrl);
}
}