<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Doubts when try yo obtaint the members of a group.</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121303611" />
  <subtitle>Doubts when try yo obtaint the members of a group.</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121303611</id>
  <updated>2026-04-04T02:23:47Z</updated>
  <dc:date>2026-04-04T02:23:47Z</dc:date>
  <entry>
    <title>RE: RE: Doubts when try yo obtaint the members of a group.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121305301" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121305301</id>
    <updated>2021-12-21T17:38:05Z</updated>
    <published>2021-12-21T17:38:05Z</published>
    <summary type="html">&lt;p&gt;Well it doesn't sound like I was much help but I'm glad you got it
  sorted. What you did looks like what I see in the &lt;a
    href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/site/site-memberships-web/src/main/java/com/liferay/site/memberships/web/internal/display/context/UsersDisplayContext.java#L288-L324"&gt;Site
    Memebership code&lt;/a&gt;, so nice work.&lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2021-12-21T17:38:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Doubts when try yo obtaint the members of a group.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121304971" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121304971</id>
    <updated>2021-12-21T12:24:00Z</updated>
    <published>2021-12-21T12:24:00Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks in advance. That answer is not working because there is users
  which are in the site because they belong to an user group which is
  assigned to the site.&lt;/p&gt;
&lt;p&gt;This is the solution that is working for me, for anyone who can need it&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;	public static List&amp;lt;User&amp;gt; getUsersOfSite(long groupId, long companyId){
        LinkedHashMap&amp;lt;String, Object&amp;gt; userParams = new LinkedHashMap();
        userParams.put(&amp;quot;inherit&amp;quot;, Boolean.TRUE);
        userParams.put(&amp;quot;usersGroups&amp;quot;, groupId);
        
        long count= UserLocalServiceUtil.searchCount(companyId, null,WorkflowConstants.STATUS_APPROVED,
                userParams);

        List&amp;lt;User&amp;gt; users = UserLocalServiceUtil.search(companyId, null ,WorkflowConstants.STATUS_APPROVED,
                userParams, 0, (int) count, (OrderByComparator) null);
        List&amp;lt;User&amp;gt; returnList = new ArrayList&amp;lt;User&amp;gt;();
        
        
        return returnList;
	}
	&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks again for the help&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2021-12-21T12:24:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Doubts when try yo obtaint the members of a group.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121304002" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121304002</id>
    <updated>2021-12-20T14:21:29Z</updated>
    <published>2021-12-20T14:21:09Z</published>
    <summary type="html">&lt;p&gt;I'd start with &lt;code&gt;userLocalService.getGroupUsers(long groupId);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt; As a proof of concept, run this script from Server Administration
  &amp;gt; Script and make sure it gives you the count that you see in the
  Site Members UI (substitue your site's groupId):&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;// ### Groovy Sample ###

number = com.liferay.portal.kernel.service.UserLocalServiceUtil.getGroupUsersCount(20123);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2021-12-20T14:21:09Z</dc:date>
  </entry>
  <entry>
    <title>Doubts when try yo obtaint the members of a group.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121303610" />
    <author>
      <name>Daniel G</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121303610</id>
    <updated>2021-12-20T11:42:05Z</updated>
    <published>2021-12-20T11:42:05Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I want to obtain the members of a site, but I am not finding the way
  to do it. I thinks it has to be an easy thing, but I am not able to do
  it. Anyone can help me? I would like to get the same users than the
  ones that are showed in the members tab of control panel&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</summary>
    <dc:creator>Daniel G</dc:creator>
    <dc:date>2021-12-20T11:42:05Z</dc:date>
  </entry>
</feed>
