<?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: Query groups per user in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787511#M1474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;thank you for this script. It worked well, but my approach needs an array per group-membership. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So it helps, but my issue was a wrong user level.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jul 2019 16:39:31 GMT</pubDate>
    <dc:creator>MichaelMarz</dc:creator>
    <dc:date>2019-07-05T16:39:31Z</dc:date>
    <item>
      <title>Query groups per user</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787508#M1471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to list all users and their groups. Actually, the script looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;user_accounts &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;users&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; user &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; user_accounts&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;user&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;firstName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;";"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; user&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;email&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;";"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; user&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;groups&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;user1 ; &lt;A href="mailto:user1@email.com" rel="nofollow noopener noreferrer" target="_blank"&gt;user1@email.com&lt;/A&gt; ; group1, group2, group3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without "user.groups" the skript is working. When querying "user.groups", a error appers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I query the groups for each user?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787508#M1471</guid>
      <dc:creator>MichaelMarz</dc:creator>
      <dc:date>2021-12-12T08:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Query groups per user</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787509#M1472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/355982"&gt;Michael Marz&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to have a look at a script which I have published on GeoNet recently:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/EPolle_TensingInternational/blog/2019/03/21/a-quick-overview-of-group-membership-in-your-agol-organization"&gt;https://community.esri.com/people/EPolle_TensingInternational/blog/2019/03/21/a-quick-overview-of-group-membership-in-your-agol-organization&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script uses the ArcGIS API for Python - with &lt;STRONG style="font-family: courier new, courier, monospace;"&gt;groups.search()&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG style="font-family: courier new, courier, monospace;"&gt;users.search()&lt;/STRONG&gt; - to get an overview of group membership within an organization. It creates a matrix - &lt;EM&gt;users along the y-axis and groups along the x-axis&lt;/EM&gt; - with a 1 or a 0 to indicate wether the user is a member of the group or not. This matrix is being written to a CSV file and can be imported to an Excel spreadsheet for further analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this serve your needs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2019 13:29:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787509#M1472</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2019-07-03T13:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Query groups per user</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787510#M1473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue was, that this approach needs a Level 2 Named User.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if a level 1 named user has the rights to see all groups and members, it is not the same with the python api.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested the lines with a level 2 named user and it worked. The groups are returned as array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:36:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787510#M1473</guid>
      <dc:creator>MichaelMarz</dc:creator>
      <dc:date>2019-07-05T16:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Query groups per user</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787511#M1474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;thank you for this script. It worked well, but my approach needs an array per group-membership. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So it helps, but my issue was a wrong user level.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:39:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/query-groups-per-user/m-p/787511#M1474</guid>
      <dc:creator>MichaelMarz</dc:creator>
      <dc:date>2019-07-05T16:39:31Z</dc:date>
    </item>
  </channel>
</rss>

