in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

echef

From the cluttered (and clustered) brain of Josef Nielsen... A great place for Food, Friends, and... uh... SharePoint of course!

Email Enabled List Alias Management

Ever notice that there is not way to centrally manage or get information about email aliases?  Oh that annoys me!  So I did what any self respecting geek would do, and I started taking it apart...  Here are a couple SQL utility scripts to help you get more out of your SharePoint!  Standard Disclaimer - Don't mess around with the DB... You can break stuff!  Now, here's the goods:

-- SQL Script to find out where an Email Alias is in use

-- Written by Josef Nielsen, 2008
-- nielsenjl_at_ldschurch.org
--
http://www.sharepointblogs.com/echef

-- Run this script against the Farm Configuration DB
SELECT [Alias], [Deleted], [SiteMap].[Path], [Objects].[Name], [ListId]
  FROM [WSS_Farm_Config].[dbo].[EmailEnabledLists]
    INNER JOIN [SiteMap] ON [EmailEnabledLists].[SiteId] = [SiteMap].[Id]
    INNER JOIN [Objects] ON [SiteMap].[DatabaseId] = [Objects].[Id]
-- Change this value to the Alias you are looking for
WHERE [Alias] = 'MyEmailAlias'  -- This is the Name part of Name@SharePoint.server.com

-- Run this script against the Content DB that the Site resides on
SELECT [tp_Title], [tp_ServerTemplate], [tp_ItemCount], [tp_Description], [tp_EmailInsertsFolder], [tp_EmailAlias], [tp_Fields], [tp_ContentTypes], [tp_DefaultWorkflowId]
FROM [WSS_ContentDB_01].[dbo].[AllLists]
--Replace the GUID Below with the GUId of the List you are looking for
WHERE [tp_Id] = 'A4BB3401-3161-430A-B330-42143C3DE879'

 

So, what do you get out of this?  Well, the first script, run against your Config DB will give you the managed path and site collection name where that alias is in use.  It will also tell you which content DB contains that site collection.  It also gives you a GUID for the List.

In the second script, add the GUID you got for the list and run it against the Content DB that was also specified by the first script.  This will give you the friendly name of the list that uses this alias, as well as a few other yummy bits of data about this list.

Enjoy!

Published May 16 2008, 10:06 AM by josef.nielsen
Filed under: , ,

Comments

No Comments

About josef.nielsen

I'm a long time computer nerd, living and loving technology wherever I can find it. I've recently shifted from a focus in MS SQL server, MSCS Clustering, and High Availability Engineering to focus on collaboration technologies, including SharePoint 2007. I recently moved from my long-time home in Seattle Washington to Salt Lake City.

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts