<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: What is the SQL query to display the active users of Alfresco in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309177#M262307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By default users are saved just as other nodes in content repository. user node &amp;nbsp;has "user" as type .It is complex to query database directly ,why do you want to execute SQL query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Sep 2016 16:15:26 GMT</pubDate>
    <dc:creator>kaynezhang</dc:creator>
    <dc:date>2016-09-24T16:15:26Z</dc:date>
    <item>
      <title>What is the SQL query to display the active users of Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309176#M262306</link>
      <description>What is the SQL query to display the active users of Alfresco.Thanks for your timeThanks for your time</description>
      <pubDate>Fri, 23 Sep 2016 22:38:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309176#M262306</guid>
      <dc:creator>joseph</dc:creator>
      <dc:date>2016-09-23T22:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: What is the SQL query to display the active users of Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309177#M262307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By default users are saved just as other nodes in content repository. user node &amp;nbsp;has "user" as type .It is complex to query database directly ,why do you want to execute SQL query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Sep 2016 16:15:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309177#M262307</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-09-24T16:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: What is the SQL query to display the active users of Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309178#M262308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ideally you would determine that number by performing a FTS query in Alfresco directly and not via SQL. The query for this would be&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;TYPE:"cm:person"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This can be executed in the node browser but be aware that it may limit the number of results shown. Alternatively, you can query using the JavaScript console and access the numberFound result property (Alfresco 5.0 and above)&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; resultSet &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; search&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;queryResultSet&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; language &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'fts-alfresco'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; query &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TYPE:"cm:person"'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="token function"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;resultSet&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;meta&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;numberFound&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you really MUST execute a SQL query, then - with minor adaptions depending on your specific database system - you can use to find out the number of person nodes created in Alfresco&lt;/P&gt;&lt;PRE class="line-numbers language-sql"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;n&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; alf_node n&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;LEFT&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;JOIN&lt;/SPAN&gt; alf_store s &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; s&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; n&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;store_id&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;LEFT&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;JOIN&lt;/SPAN&gt; alf_qname q &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; q&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; n&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;type_qname_id&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;LEFT&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;JOIN&lt;/SPAN&gt; alf_namespace ns &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; ns&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; q&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ns_id&lt;BR /&gt;&lt;SPAN class="keyword token"&gt;WHERE&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; s&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;protocol &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'workspace'&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt; s&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;identifier &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SpacesStore'&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt; q&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;local_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'person'&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt; ns&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;uri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; 'http:&lt;SPAN class="comment token"&gt;//www.alfresco.org/model/content/1.0'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Be aware though that all of this is only an approximation. If you have configured an authentication subsystem against an LDAP, AD or other external user directory, the number of users that can login may be much higher unless you have also configured a synchronization that ensures ALL users are proactively synchronized. Additionally, when users are disabled in LDAP / AD they are still contained in Alfresco though they can no longer login.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing: If you want to find out the number of users that are CURRENTLY USING the system (instead of the number of users maintained in the system) I suggest you use the &lt;A href="https://github.com/Alfresco/alfresco-support-tools" rel="nofollow noopener noreferrer"&gt;Support Tools addon&lt;/A&gt; if you are an Enterprise user or the &lt;A href="https://github.com/AFaust/ootbee-support-tools" rel="nofollow noopener noreferrer"&gt;"Liberated" Support Tools addon&lt;/A&gt; if you are running Community. Both provide a tool called "Active Sessions" that displays the number of currently logged in users whose tickets have not yet expired.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Sep 2016 20:55:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309178#M262308</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-09-24T20:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is the SQL query to display the active users of Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309179#M262309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE ___default_attr="javascript" _modifiedtitle="true" class="jive_macro_code jive_text_macro" data-hasrefreshed="true" data-renderedposition="8_8_1313_112"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for your answers. We finally did it using Lucene search:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1475175038181893" data-hasrefreshed="true" data-renderedposition="33.94999694824219_8_1313_80" jivemacro_uid="_1475175038181893" modifiedtitle="true"&gt;&lt;P&gt;var resultSet = search.luceneSearch('TYPE:"cm:person" AND -ASPECT:"cm:personDisabled"', "@sys:node-uuid", true, -1);&lt;/P&gt;&lt;P&gt;for (var i = 0; i &amp;lt; resultSet.length; i++) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(resultSet[i].getProperties()["cm:userName"]);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 18:51:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/what-is-the-sql-query-to-display-the-active-users-of-alfresco/m-p/309179#M262309</guid>
      <dc:creator>joseph</dc:creator>
      <dc:date>2016-09-29T18:51:19Z</dc:date>
    </item>
  </channel>
</rss>

