English
Continue in the app
Be The First To Get Support Updates
Want to know about the latest technical content and software updates?

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

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)

Related Information

Last Published: 7/28/2022

Article ID: 000027939

Software: ArcGIS API for Python 2.0.1, 2.0, 1.9.1, 1.9, 1.8.5, 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.1, 1.7.0, 1.6.1, 1.6 Portal for ArcGIS 10.9.1, 10.9, 10.8.1, 10.8, 10.7.1, 10.7, 10.6.1, 10.6