1

I want to return a list of all users in my ArcGIS Online (AGOL) organization. However, the result returned in gis.users.search() appears limited to 100 users.

Is there any way to return all users or to perform multiple searches until all users are found?

2

Try using the UserManager with the Python API. The UserManager has an option for max_records which can be set to the number of users in your group

from arcgis.gis import GIS
import arcgis 

gis = GIS("https://www.arcgis.com", "USERNAME", "PASSWORD") # set first arguement to your Portal or AGOL
users = arcgis.gis.UserManager(gis)

# get the total number of users in your AGOL account provided you have administrative priveledges
totalUsers = users.counts('user_type', as_df=False)[0]['count']

# use the total number of users in your AGOL Account as an arguement for max_users
allUsers = users.search(query=None, max_users=totalUsers)
3
  • ArcGIS Enterprise 10.6.1 returns "NotImplementedError: counts is not implemented at version 6.1 of Enterprise" - is there a workaround? – wunderkind Aug 26 '20 at 2:28
  • 1
    @wunderkind I updated my answer so that it even simpler than before. But in regards to Enterprise. I don't have access to Enterprise but the docs developers.arcgis.com/python/api-reference/… Still list "counts" for Enterprise or AGOL – F_Kellner Aug 26 '20 at 17:17
  • @F_Kellner - please email me: khibma@esri.ca - I have something to help. – KHibma Sep 2 '20 at 18:55
1

Go download the free Admin tools from GeoJobe available in the ArcGIS online store. Believe it creates an Excel output

-1

While it's true that each individual query returns a max of 100 records, you can use pagination to send multiple requests for up to 10000 results.

https://developers.arcgis.com/rest/users-groups-and-items/search.htm - see the start and num parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.