HOW TO

Identify the sharing level of all the items of an owner in Portal for ArcGIS

Last Published: July 29, 2022

Summary

By default, maps, layers, and other items added or published to Portal for ArcGIS are only accessible to the owner. The sharing level can be viewed by opening the services individually. However, this process can be automated using ArcGIS API for Python. Follow the workflow described in this article to identify the sharing levels of all the items of a specific owner in Portal for ArcGIS.

Procedure

  1. Import the necessary modules.
from arcgis.gis import GIS
  1. Specify the Portal for ArcGIS credentials to use.
gis = GIS('https://<machine>.<domain>.com:7443/arcgis', 'Username', 'Password', verify_cert=False)
print ('Connected')
  1. Search all the items of the specific owner.
items = gis.content.search ('owner:<Owner_Name>', max_items=-1)
  1. Iterate through the items of the specific owner and determine the sharing level of the items.
for file in items:
    print (file.title, file.shared_with)

The code block below demonstrates the full script.

from arcgis.gis import GIS

gis = GIS('https://testdomain.esri.com:7443/arcgis', 'username', 'password', verify_cert=False)
print('Connected')

items = gis.content.search('owner:Owner123', max_items=-1)

for i in items:
	print(i.title, i.shared_with)

Article ID:000027939

Software:
  • Portal for ArcGIS
  • ArcGIS API for Python 1 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic