Thursday, June 14, 2012

SharePoint Find Site URL by GUID

To find the full URL of a site from its GUID (when you have the database GUID):
  •  Find out which database it is in: Go to Central Administration, Operations, Servers in Farm
  • Note the name of the configuration database and the database server 
  •  On the database instance for SharePont, execute the following command (replacing the Name_of_Config_DB and the GUID_of_Database with the items noted from the previous step):
  •   SELECT ID, Name
    FROM [Name_of_Config_DB].[dbo].[Objects]
    WHERE ID = ' GUID_of_Database'


    With the name of the content database, you can run another SQL query to get the name of the Web site: 
  • SELECT [Id], [SiteId], [FullUrl]
    FROM [Name_of_Content_DB].[dbo].[Objects]
    WHERE ID = 'GUID_of_Site_Collection'
  •  You can also perform an sts command to find the GUIDs of all sites within a content database to match the GUID: sts adm -o enumallwebs -databasename name_of_database
  • (replace name_of_database with the name of your database)

No comments:

Post a Comment