<?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 bulk delete protect and mark as authoritative?  in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501024#M19496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see with&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/220209-set-data-item-as-authoritative-with-api-for-python"&gt;https://community.esri.com/thread/220209-set-data-item-as-authoritative-with-api-for-python&lt;/A&gt;&amp;nbsp;I can do it one item at a time....how to do on all items say, owned by Sasquatch? While I'm on this thread, how to assign the same number of items to a single Category, at once?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jun 2019 19:10:11 GMT</pubDate>
    <dc:creator>ThomasColson</dc:creator>
    <dc:date>2019-06-27T19:10:11Z</dc:date>
    <item>
      <title>How to bulk delete protect and mark as authoritative?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501021#M19493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a bunch of (my) content that I want to mark as authoritative and delete protect in Portal 10.6.1. I see that there is an API for delete protect&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/protect.htm"&gt;https://developers.arcgis.com/rest/users-groups-and-items/protect.htm&lt;/A&gt;&amp;nbsp;is there something similar for mark as authoritative? And can this be done with Python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2019 18:42:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501021#M19493</guid>
      <dc:creator>ThomasColson</dc:creator>
      <dc:date>2019-06-27T18:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to bulk delete protect and mark as authoritative?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501022#M19494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/451711_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2019 18:46:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501022#M19494</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2019-06-27T18:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to bulk delete protect and mark as authoritative?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501023#M19495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking for a python way to do this on thousands of items at once. ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2019 19:08:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501023#M19495</guid>
      <dc:creator>ThomasColson</dc:creator>
      <dc:date>2019-06-27T19:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to bulk delete protect and mark as authoritative?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501024#M19496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see with&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/220209-set-data-item-as-authoritative-with-api-for-python"&gt;https://community.esri.com/thread/220209-set-data-item-as-authoritative-with-api-for-python&lt;/A&gt;&amp;nbsp;I can do it one item at a time....how to do on all items say, owned by Sasquatch? While I'm on this thread, how to assign the same number of items to a single Category, at once?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2019 19:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501024#M19496</guid>
      <dc:creator>ThomasColson</dc:creator>
      <dc:date>2019-06-27T19:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to bulk delete protect and mark as authoritative?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501025#M19497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thousands???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get a list of all your item id's&amp;nbsp; Put them in an Access table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy the python script to a new Access Table.&amp;nbsp; Two tables one that is thousands and one that is just the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the script so that the variables match your environment. other than &amp;lt;item id&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add to the bottom of the script&lt;/P&gt;&lt;P&gt;del gis&lt;/P&gt;&lt;P&gt;del item1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this does not delete the gis or the item it just deletes them from the running python script so they can be used 1000's of times.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add both tables to a create query session.&amp;nbsp; add the long one as the first field ad the script as the second field.&amp;nbsp; Then do a make table.&amp;nbsp; &amp;nbsp;This will create a new table that has your id's on the left and the script on the right.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then make another query to replace the&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;&amp;lt;item ID&amp;gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;with the value from the left column.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2019 19:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/501025#M19497</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2019-06-27T19:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to bulk delete protect and mark as authoritative?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/1198806#M33656</link>
      <description>&lt;P&gt;Thomas, we have been having some issues with 10.9.1 and overwriting services. I believe you are looking for something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;objGIS = None&lt;BR /&gt;def msg(message):&lt;BR /&gt;arcpy.AddMessage(message)&lt;BR /&gt;return&lt;BR /&gt;def updateProtection(condition, item_id):&lt;BR /&gt;msg(f'Updating settings for {item_id}')&lt;BR /&gt;try:&lt;BR /&gt;objGIS = GIS(gis_url, username, password)&lt;BR /&gt;except Exception as e:&lt;BR /&gt;msg(e)&lt;BR /&gt;try:&lt;BR /&gt;for i in item_id.split(";"):&lt;BR /&gt;item = objGIS.content.get(f"{i}")&lt;BR /&gt;if condition == "enable":&lt;BR /&gt;item.protect(enable = True)&lt;BR /&gt;item.content_status = 'org_authoritative'&lt;BR /&gt;else:&lt;BR /&gt;item.protect(enable = False)&lt;BR /&gt;except Exception as e:&lt;BR /&gt;msg(e)&lt;BR /&gt;return&lt;BR /&gt;if __name__ == '__main__':&lt;BR /&gt;gis_url = arcpy.GetParameterAsText(0)&lt;BR /&gt;username = arcpy.GetParameterAsText(1)&lt;BR /&gt;password = arcpy.GetParameterAsText(2)&lt;BR /&gt;item_id = arcpy.GetParameterAsText(3)&lt;BR /&gt;condition = arcpy.GetParameterAsText(4)&lt;BR /&gt;updateProtection(condition, item_id)&lt;BR /&gt;msg("complete")&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 02:14:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/1198806#M33656</guid>
      <dc:creator>RyanDickinson1</dc:creator>
      <dc:date>2022-08-03T02:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to bulk delete protect and mark as authoritative?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/1580566#M41563</link>
      <description>&lt;P&gt;this article was super helpful to me figuring out how to &lt;A href="https://learn.finaldraftmapping.com/adding-delete-protection-for-arcgis-online-content-items-with-the-arcgis-api-for-python/" target="_self"&gt;mark a single item authoritative and enable delete protection via the API&lt;/A&gt;&amp;nbsp;from one of Esri Community's newest MVPs,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/417766"&gt;@Clubdebambos&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;I'd recommend using &lt;A href="https://developers.arcgis.com/python/latest/guide/accessing-and-creating-content/#searching-for-content" target="_self"&gt;search&lt;/A&gt; to narrow down your thousands of items by &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types/" target="_self"&gt;item type&lt;/A&gt;, then the for/in loop below to enable delete protection and mark as authoritative on each item in your list.&lt;BR /&gt;&lt;BR /&gt;in the Python Window of ArcGIS Pro 3.4 / ArcGIS Enterprise 11.3:&lt;/P&gt;&lt;PRE&gt;items = gis.content.search(query='',&lt;SPAN&gt;item_type=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"xxx",&lt;/SPAN&gt;)&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/python/latest/guide/accessing-and-creating-content/#searching-for-content-with-multiple-filtering-clauses" target="_self"&gt;len(items)&lt;/A&gt; # to get count of items in list&lt;BR /&gt;for item in items:&lt;BR /&gt;    item.&lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.protect" target="_self"&gt;protect()&lt;/A&gt;&lt;BR /&gt;    item.&lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.content_status" target="_self"&gt;content_status&lt;/A&gt; = "authoritative"&lt;/PRE&gt;&lt;P&gt;additional search references:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/knowledge-base/how-to-find-specific-items-using-queries-in-the-arcgis--000024383" target="_self"&gt;How To:&amp;nbsp;Find specific items using queries in the arcgis.gis module with ArcGIS API for Python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/latest/guide/accessing-and-creating-content/" target="_self"&gt;Accessing and creating content via the API&lt;/A&gt;&amp;nbsp;(be sure to read the &lt;A href="https://developers.arcgis.com/python/latest/guide/accessing-and-creating-content/#about-search" target="_self"&gt;"About search" section&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 19:48:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-bulk-delete-protect-and-mark-as/m-p/1580566#M41563</guid>
      <dc:creator>ToddW_stl</dc:creator>
      <dc:date>2025-01-30T19:48:26Z</dc:date>
    </item>
  </channel>
</rss>

