-- All users in site collection
Select tp_Title,tp_Login, tp_IsActive from UserInfo order by tp_Title,tp_Login, tp_IsActive
-- All users in a group
Select Distinct Title, tp_Title,tp_Login from Groups gr
inner join GroupMembership grm on gr.ID = grm.GroupID
inner join UserInfo usr on usr.tp_ID = grm.MemberId
order by Title,tp_Title,tp_Login
-- All groups for a user
Select Distinct tp_Title,tp_Login, Title from Groups gr
inner join GroupMembership grm on gr.ID = grm.GroupID
inner join UserInfo usr on usr.tp_ID = grm.MemberId
order by tp_Title,tp_Login,Title
Thanks to my mate Navneet Singh.
No comments:
Post a Comment