<?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: Export list of groups with members/owners/manager in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-list-of-groups-with-members-owners-manager/m-p/1502263#M10308</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/807197"&gt;@KaluRibushDTP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the group object &lt;STRONG&gt;user_list()&lt;/STRONG&gt; method instead to return this information. Documentation &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Group.user_list" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The method returns a dictionary that contains two key: &lt;EM&gt;owner&lt;/EM&gt; and &lt;EM&gt;users&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value for the &lt;EM&gt;owner&lt;/EM&gt; is a a dictionary.&lt;/P&gt;&lt;P&gt;The value for the &lt;EM&gt;users&lt;/EM&gt; is a list of dictionaries containing information about each other member that is not the owner. Each dictionary has a &lt;EM&gt;&lt;STRONG&gt;memberType&lt;/STRONG&gt; &lt;/EM&gt;key with a value of &lt;EM&gt;&lt;STRONG&gt;admin &lt;/STRONG&gt;&lt;/EM&gt;for a group manager or &lt;EM&gt;&lt;STRONG&gt;member&lt;/STRONG&gt; &lt;/EM&gt;for all other members.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 06:46:20 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2024-07-08T06:46:20Z</dc:date>
    <item>
      <title>Export list of groups with members/owners/manager</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-list-of-groups-with-members-owners-manager/m-p/1502248#M10307</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I've got code below which works well to export list of groups and members, but I want to also include the group owners and managers in the export (not just members).&lt;/P&gt;&lt;P&gt;How do I tweak this?&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from arcgis.gis import GIS&lt;BR /&gt;from datetime import datetime&lt;BR /&gt;import pandas as pd #import pandas module&lt;BR /&gt;&lt;BR /&gt;gis = GIS("pro") #login using Pro authentication&lt;BR /&gt;&lt;BR /&gt;# groups&lt;BR /&gt;grps = gis.groups.search(max_groups=10000)&lt;BR /&gt;&lt;BR /&gt;grp_list = []&lt;BR /&gt;for g in grps:&lt;BR /&gt;for u in g.get_members()['users']:&lt;BR /&gt;grp_list.append({'group':g.title, 'user':u})&lt;BR /&gt;g_df = pd.DataFrame(grp_list)&lt;BR /&gt;&lt;BR /&gt;#users&lt;BR /&gt;users = gis.users.search(max_users=10000)&lt;BR /&gt;user_list = []&lt;BR /&gt;for u in users:&lt;BR /&gt;user_list.append({'user':u.username, 'role':u.role, 'email':u.email})&lt;BR /&gt;u_df = pd.DataFrame(user_list)&lt;BR /&gt;&lt;BR /&gt;#set path to output file&lt;BR /&gt;outputFile = r"C:\Data\Temp\Groups_Members_"+datetime.now().strftime("%Y-%m-%d")+".CSV" # change if required&lt;BR /&gt;&lt;BR /&gt;# output merged doc&lt;BR /&gt;g_df.merge(u_df, on='user', how='left').to_csv(outputFile)&lt;/P&gt;&lt;P&gt;print("finished")&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 04:51:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/export-list-of-groups-with-members-owners-manager/m-p/1502248#M10307</guid>
      <dc:creator>KaluRibushDTP</dc:creator>
      <dc:date>2024-07-08T04:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export list of groups with members/owners/manager</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-list-of-groups-with-members-owners-manager/m-p/1502263#M10308</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/807197"&gt;@KaluRibushDTP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the group object &lt;STRONG&gt;user_list()&lt;/STRONG&gt; method instead to return this information. Documentation &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Group.user_list" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The method returns a dictionary that contains two key: &lt;EM&gt;owner&lt;/EM&gt; and &lt;EM&gt;users&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value for the &lt;EM&gt;owner&lt;/EM&gt; is a a dictionary.&lt;/P&gt;&lt;P&gt;The value for the &lt;EM&gt;users&lt;/EM&gt; is a list of dictionaries containing information about each other member that is not the owner. Each dictionary has a &lt;EM&gt;&lt;STRONG&gt;memberType&lt;/STRONG&gt; &lt;/EM&gt;key with a value of &lt;EM&gt;&lt;STRONG&gt;admin &lt;/STRONG&gt;&lt;/EM&gt;for a group manager or &lt;EM&gt;&lt;STRONG&gt;member&lt;/STRONG&gt; &lt;/EM&gt;for all other members.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 06:46:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/export-list-of-groups-with-members-owners-manager/m-p/1502263#M10308</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-07-08T06:46:20Z</dc:date>
    </item>
  </channel>
</rss>

