<?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: Get a list of all users in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136009#M36547</link>
    <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;How do I check if the user account is enabled? I tried&lt;/P&gt;&lt;P&gt;if (isAccountEnabled(search.findNode(users[i]).properties.userName))&lt;/P&gt;&lt;P&gt;but that does not work.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 12:56:26 GMT</pubDate>
    <dc:creator>PVanhoof</dc:creator>
    <dc:date>2022-08-17T12:56:26Z</dc:date>
    <item>
      <title>Get a list of all users</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136007#M36545</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have following code to list all users:&lt;/P&gt;&lt;PRE&gt;users = people.getPeople(null, 0)
for (var i=0; i&amp;lt;users.length; i++)
{
	log = users[i].properties.userName + "\n";
	logFile.content += log; 
}&lt;/PRE&gt;&lt;P&gt;However this does not work, I get an error on the log line.&lt;/P&gt;&lt;P&gt;I also tried users[i].properties["userName"], but that does not work either...&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1561i7F3AA8C8CAFDBA70/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 09:27:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136007#M36545</guid>
      <dc:creator>PVanhoof</dc:creator>
      <dc:date>2022-08-08T09:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all users</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136008#M36546</link>
      <description>&lt;P&gt;That's not a correct way. people api retruns scriptbale object so basically you get string valued nodeRefs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to have actual node object in order to access properties.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Update the line to :&lt;/P&gt;
&lt;PRE&gt;log = &lt;STRONG&gt;search.findNode(users[i])&lt;/STRONG&gt;.properties.userName + "\n";
&lt;/PRE&gt;
&lt;P&gt;These are REST APIs you can use as well to get the same details:&lt;/P&gt;
&lt;P&gt;V1 API: http://&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;/alfresco/api/-default-/public/alfresco/versions/1/people&lt;/P&gt;
&lt;P&gt;Repo Api: http://&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;/alfresco/service/api/people&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 20:45:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136008#M36546</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2022-08-08T20:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all users</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136009#M36547</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;How do I check if the user account is enabled? I tried&lt;/P&gt;&lt;P&gt;if (isAccountEnabled(search.findNode(users[i]).properties.userName))&lt;/P&gt;&lt;P&gt;but that does not work.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 12:56:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136009#M36547</guid>
      <dc:creator>PVanhoof</dc:creator>
      <dc:date>2022-08-17T12:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get a list of all users</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136010#M36548</link>
      <description>&lt;P&gt;people.isAccountEnabled() should work:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.huihoo.com/javadoc/alfresco/4.2/repository/org/alfresco/repo/jscript/People.html#isAccountEnabled(java.lang.String" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.huihoo.com/javadoc/alfresco/4.2/repository/org/alfresco/repo/jscript/People.html#isAccountEnabled(java.lang.String&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 17:32:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/get-a-list-of-all-users/m-p/136010#M36548</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2022-08-17T17:32:47Z</dc:date>
    </item>
  </channel>
</rss>

