<?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: How to use arcpy to get a list of Portal users in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233533#M18116</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the ArcGIS API for Python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcgis.gis import GIS
# replace the your URL, your username and your password with the relevant 
# information for your organization
# you must use an admin account to generate users

gis = GIS("&lt;A href="https://maps.cob.org/portal" rel="nofollow noopener noreferrer" target="_blank"&gt;https://&amp;lt;your URL&amp;gt; /portal&lt;/A&gt;", "&amp;lt;your username&amp;gt;","&amp;lt;your password&amp;gt;")
users = gis.users.search("*")
for i in users:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(i.username, " " , i.email)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # see &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#user" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#user&lt;/A&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # for other things you can print out for each user
&amp;nbsp;&amp;nbsp;&amp;nbsp; # see &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#usermanager" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#usermanager&lt;/A&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # for ways to search and sort users&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:13:13 GMT</pubDate>
    <dc:creator>AnnStark2</dc:creator>
    <dc:date>2021-12-12T16:13:13Z</dc:date>
    <item>
      <title>How to use arcpy to get a list of Portal users</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233529#M18112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know of a way to use arcpy to obtain a list of the current users in a Portal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to set up a python script that reconciles versioned datasets each night, and instead of hardcoding the usernames to search for in the versions I would prefer that the script got the list of current users directly from Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 12:02:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233529#M18112</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-10-19T12:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use arcpy to get a list of Portal users</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233530#M18113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get portalpy from esri/github.&lt;/P&gt;&lt;P&gt;There is a portal.get_org_users() method to the portal object.&lt;/P&gt;&lt;P&gt;And a bunch of other useful portal functions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 12:48:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233530#M18113</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-10-19T12:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use arcpy to get a list of Portal users</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233531#M18114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The link to what Neil mentions&amp;nbsp; &lt;A href="https://github.com/Esri/portalpy" title="https://github.com/Esri/portalpy"&gt;Esri/portalpy · GitHub&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and description...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="font-size: 2.25em; margin-bottom: 16px; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;"&gt;Portalpy&lt;/H1&gt;&lt;P style="margin-bottom: 16px; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px;"&gt;Portalpy is a Python module that allows you to administer Portal for ArcGIS and ArcGIS Online. &lt;/P&gt;&lt;H2 style="margin-top: 1em; margin-bottom: 16px; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;"&gt;&lt;A class="anchor" href="https://github.com/Esri/portalpy#features" style="color: #4078c0; padding-right: 2px; margin-left: -18px;"&gt;&lt;SPAN class="octicon-link octicon" style="font-weight: normal; font-size: 16px; font-family: octicons; color: #000000;"&gt;&lt;/SPAN&gt;&lt;/A&gt;Features&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;Designed to be easy. Most tasks require just a few lines of code.&lt;/LI&gt;&lt;LI&gt;Allows user and group management.&lt;/LI&gt;&lt;LI&gt;Fully-documented.&lt;/LI&gt;&lt;LI&gt;Includes unit tests.&lt;/LI&gt;&lt;/UL&gt;&lt;H2 style="margin-top: 1em; margin-bottom: 16px; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif;"&gt;&lt;A class="anchor" href="https://github.com/Esri/portalpy#requirements" style="color: #4078c0; padding-right: 2px; margin-left: -18px;"&gt;https://github.com/Esri/portalpy#requirements&lt;/A&gt;Requirements&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;Python 2.7&lt;/LI&gt;&lt;LI&gt;Works with ArcGIS Online and all versions of Portal.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 15:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233531#M18114</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-10-19T15:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use arcpy to get a list of Portal users</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233532#M18115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Neil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's exactly what I needed - didn't know it existed but after a quick look I can see it becoming very useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 20:22:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233532#M18115</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-10-19T20:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use arcpy to get a list of Portal users</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233533#M18116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the ArcGIS API for Python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcgis.gis import GIS
# replace the your URL, your username and your password with the relevant 
# information for your organization
# you must use an admin account to generate users

gis = GIS("&lt;A href="https://maps.cob.org/portal" rel="nofollow noopener noreferrer" target="_blank"&gt;https://&amp;lt;your URL&amp;gt; /portal&lt;/A&gt;", "&amp;lt;your username&amp;gt;","&amp;lt;your password&amp;gt;")
users = gis.users.search("*")
for i in users:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(i.username, " " , i.email)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # see &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#user" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#user&lt;/A&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # for other things you can print out for each user
&amp;nbsp;&amp;nbsp;&amp;nbsp; # see &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#usermanager" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#usermanager&lt;/A&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # for ways to search and sort users&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:13:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-get-a-list-of-portal-users/m-p/233533#M18116</guid>
      <dc:creator>AnnStark2</dc:creator>
      <dc:date>2021-12-12T16:13:13Z</dc:date>
    </item>
  </channel>
</rss>

