Database query to get all the MOSS groups a user belongs to for a web application

SELECT U.tp_Title As User_Full_Name, G.[Title] As Group_Name
FROM [Groups] As G, [GroupMembership] As GM, [UserInfo] As U
Where GM.GroupId=G.ID
and GM.MemberId=U.tp_ID
and U.tp_SiteID=’xx99′
and U.tp_Login like ‘%username%’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s