Tuesday, March 25, 2014

Getting the GUID of a SharePoint site collection

You can get the GUID by the following ways:
1-   Powershell (SharePoint 2010):
PS > $mysite =  Get-SPSite <SITE_URL>
PS > $mysite.id

2-   Stsadm Command Line (MOSS 2007 & SharePoint 2010):
Stsadm -o enumsites -url <SITE_URL>

3-   SQL Server (MOSS 2007 & SharePoint 2010):
Run the following query on the designated content db:
select SiteId from Webs where webs.FullUrl Like '<SITE_URL>' AND ParentWebId IS NULL

No comments:

Post a Comment