How to bulk delete protect and mark as authoritative?

104
4
06-27-2019 11:42 AM
Highlighted
MVP Frequent Contributor

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 https://developers.arcgis.com/rest/users-groups-and-items/protect.htm is there something similar for mark as authoritative? And can this be done with Python?

Reply
0 Kudos
4 Replies
Highlighted
Frequent Contributor II

Reply
0 Kudos
Highlighted
MVP Frequent Contributor

Looking for a python way to do this on thousands of items at once. ...

Reply
0 Kudos
Highlighted
MVP Frequent Contributor

I see with https://community.esri.com/thread/220209-set-data-item-as-authoritative-with-api-for-python 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?

Reply
0 Kudos
Highlighted
Frequent Contributor II

Thousands???

Get a list of all your item id's  Put them in an Access table

Copy the python script to a new Access Table.  Two tables one that is thousands and one that is just the script.

Change the script so that the variables match your environment. other than <item id>

Add to the bottom of the script

del gis

del item1

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. 

add both tables to a create query session.  add the long one as the first field ad the script as the second field.  Then do a make table.   This will create a new table that has your id's on the left and the script on the right. 

Then make another query to replace the 

<item ID>

with the value from the left column.  

Reply
0 Kudos