HOW TO

Identify the sharing level of all the items of an owner in ArcGIS Online or the ArcGIS Enterprise portal

Last Published: August 15, 2025

Summary

By default, maps, layers, and other items added or published to ArcGIS Online or the ArcGIS Enterprise portal are only accessible to the owner. The sharing level can be viewed by opening the services individually or from the Content tab. 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 items owned by a specific user in ArcGIS Online or the ArcGIS Enterprise portal.

Procedure

  1. Import the necessary modules.
from arcgis.gis import GIS
  1. Specify the ArcGIS Online or the ArcGIS Enterprise portal credentials to use.
#For ArcGIS Online
gis = GIS('https://arcgis.com', '<username>', '<password>')

#For the ArcGIS Enterprise portal
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 Python version 2.3 and prior
for file in items: print (file.title, file.shared_with)

#For Python version 2.4
for file in items:
    print (file.title, file.sharing.shared_with)

The code block below demonstrates the full script in the ArcGIS Enterprise portal with Python version 2.4.

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.sharing.shared_with)

Article ID: 000027939

Software:
  • ArcGIS Online
  • Portal for ArcGIS
  • ArcGIS API for Python 1 x
  • ArcGIS Enterprise 11 3
  • ArcGIS Enterprise 11 4
  • ArcGIS Enterprise 11 5

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options