<?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 ArcGIS Portal Housekeeping using ArcPy in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-portal-housekeeping-using-arcpy/m-p/768439#M595</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;BR /&gt; &lt;BR /&gt;I created a code to remove inactive users from Portal after 90 days of inactivity.&lt;BR /&gt;The code runs through the list of users and removes users who have not logged in since 90 days and reassigns their content to Portal administrator.&lt;/P&gt;&lt;P&gt;Is there a way I can delete users who do not have any content on Portal?&lt;BR /&gt;I can loop in throgh the list of users but to check wherther they have content or not seems like a challange.&lt;BR /&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;If required I can provide code snippets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Feb 2020 03:52:31 GMT</pubDate>
    <dc:creator>YatharthSah</dc:creator>
    <dc:date>2020-02-28T03:52:31Z</dc:date>
    <item>
      <title>ArcGIS Portal Housekeeping using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-portal-housekeeping-using-arcpy/m-p/768439#M595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;BR /&gt; &lt;BR /&gt;I created a code to remove inactive users from Portal after 90 days of inactivity.&lt;BR /&gt;The code runs through the list of users and removes users who have not logged in since 90 days and reassigns their content to Portal administrator.&lt;/P&gt;&lt;P&gt;Is there a way I can delete users who do not have any content on Portal?&lt;BR /&gt;I can loop in throgh the list of users but to check wherther they have content or not seems like a challange.&lt;BR /&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;If required I can provide code snippets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2020 03:52:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-portal-housekeeping-using-arcpy/m-p/768439#M595</guid>
      <dc:creator>YatharthSah</dc:creator>
      <dc:date>2020-02-28T03:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Portal Housekeeping using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-portal-housekeeping-using-arcpy/m-p/768440#M596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When looping through the users, just do a content search for all items owned by a particular user and then check the length of the list.&amp;nbsp; If the length is 0, then you can delete the user.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;search_result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;query&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"owner:"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; userName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; item_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; max_items &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;99999&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outside_org&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&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;length&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;search_result&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-portal-housekeeping-using-arcpy/m-p/768440#M596</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2021-12-12T08:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Portal Housekeeping using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-portal-housekeeping-using-arcpy/m-p/768441#M597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response William . I will give it a try .&lt;BR /&gt;By right, this seems to be the only and correct method of checking content. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2020 06:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-portal-housekeeping-using-arcpy/m-p/768441#M597</guid>
      <dc:creator>YatharthSah</dc:creator>
      <dc:date>2020-03-02T06:02:30Z</dc:date>
    </item>
  </channel>
</rss>

