Monday, February 15, 2010

SharePoint Group Membership for specific site

I you want to get a list of all groups and the members in a site collection you can use this sql script.

Replace the SITE GUID with the guid of site collection for which you want this list

SELECT

tp_title AS [User name],

tp_Email as [Mail address],

Title as [SharePoint group]

FROM

GroupMembership

INNER JOIN UserInfo ON GroupMembership.MemberID=UserInfo.tp_ID and GroupMembership.SiteID=UserInfo.tp_SiteID

INNER JOIN Groups ON GroupMembership.GroupID=Groups.ID and GroupMembership.SiteID=Groups.SiteId

WHERE

GroupMembership.SiteID='SITE GUID'

No comments: