locked
how to list all Group members by STSADM command RRS feed

  • Question

  • Hi, Does anybody can help to show me how to use STSADM on MOSS2007 to get all group member ? I don't want check one by one because we have at least 200 group.

     

    Thanks


    James Liang
    • Edited by Mike Walsh FIN Wednesday, June 8, 2011 6:43 AM Group member in Title changed to all Group members (as specificed in the text)
    Tuesday, June 7, 2011 10:50 PM

Answers

  • Hi,

     

    According to your description, stsadm will let you list the groups on your SharePoint site. It will also let you list the users on your SharePoint site. It just wont let you enumerate the group memberships of the users on your site.

    This really simple SQL query will list all active users on the site and the groups they are members of.

    SELECT Groups.Title, UserInfo.tp_Login, UserInfo.tp_Title, UserInfo.tp_Email
    FROM GroupMembership INNER JOIN
    Groups ON GroupMembership.GroupId = Groups.ID INNER JOIN
    UserInfo ON GroupMembership.MemberId = UserInfo.tp_ID
    where userinfo.tp_isactive = '1'
    order by userinfo.tp_Login

    Best Regards
    David Hu
    • Marked as answer by JamesLiang Thursday, June 9, 2011 3:31 PM
    Thursday, June 9, 2011 2:03 AM

All replies

  • This is not possible using STSADM, you have to code for this, refer to the following link for more information  http://stackoverflow.com/questions/325007/get-users-by-group-in-sharepoint
    --Cheers
    Wednesday, June 8, 2011 9:39 AM
  • Hi James ,

     

    I understand that you want to list group members using stsadm.exe .

    1.       Open the Command prompt and change the path to the c:\\Programm Files \Common Files\Microsoft Shared \Web Serve Extensions\12\Bin .

    2.       Type in stsadm.exe –o enumusers  –url  < url  > .

     

    It will list all the users in the url you specify .But the users are not grouped by the group they belong to  .They are shown together .

     

    For more information about stsadm.exe ,you can refer to this site:

    Complete reference of all STSADM operations (with parameters) in MOSS 2007: http://blogs.technet.com/b/josebda/archive/2007/03/22/complete-reference-of-all-stsadm-commands-with-options-in-moss-2007.aspx

     

    Thanks ,


    Regards, Rock Wang Microsoft Online Community Support
    Wednesday, June 8, 2011 10:42 AM
  • Prasath,

      or can we use username to find out which group he has joined ?

     

    Thanks


    James Liang
    Wednesday, June 8, 2011 3:15 PM
    • Marked as answer by JamesLiang Thursday, June 9, 2011 12:42 AM
    • Unmarked as answer by Mike Walsh FIN Thursday, June 9, 2011 8:44 AM
    Wednesday, June 8, 2011 3:23 PM
  • Prasath,

      Thanks a lot, I will try although I'm not familiar the code.


    James Liang
    Thursday, June 9, 2011 12:44 AM
  • Hi,

     

    According to your description, stsadm will let you list the groups on your SharePoint site. It will also let you list the users on your SharePoint site. It just wont let you enumerate the group memberships of the users on your site.

    This really simple SQL query will list all active users on the site and the groups they are members of.

    SELECT Groups.Title, UserInfo.tp_Login, UserInfo.tp_Title, UserInfo.tp_Email
    FROM GroupMembership INNER JOIN
    Groups ON GroupMembership.GroupId = Groups.ID INNER JOIN
    UserInfo ON GroupMembership.MemberId = UserInfo.tp_ID
    where userinfo.tp_isactive = '1'
    order by userinfo.tp_Login

    Best Regards
    David Hu
    • Marked as answer by JamesLiang Thursday, June 9, 2011 3:31 PM
    Thursday, June 9, 2011 2:03 AM
  • JamesLiang:

    You only mark a post as an answer when you have tried it out and found that it works.

    You do not mark a post and then say "I will try although I'm not familiar the code." because this means you have not tried it out (and in fact are unsure that you can get it to work).

    Please try to avoid marking posts as answers too quickly!  (I have unmarked the post - please mark it again *after* you have found that it does solve your problem)

    Moderator


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Thursday, June 9, 2011 8:44 AM
  • Mike,

      Thanks your advise. original I give up this issue because I don't know how to use code. but David let me know use query to get answer. that's better than code.

     

    David,

      Thanks a lot, that's easy than code for me. do you know can we use "update" function for user title that is appear on "People and Group" ? because it is different with "My Site" user profile although AD Sync is on (This is my original question and after research, I need delete user name and create again , so I need to know this user belong to which group then after recreat, I need reset this user into group).

     

     

    Thanks all.


    James Liang
    Thursday, June 9, 2011 4:49 PM