HOW TO

Determine the maximum number of users per user type using ArcGIS API for Python

Last Published: May 3, 2024

Summary

With ArcGIS Online Subscription and ArcGIS Enterprise licenses, there are limited number of users allowed for each available user type. It is important to identify the maximum number of users allowed for each user type to manage the flow and to avoid exceeding the quota, as described in the following knowledge base article, Error: Your organization has reached the maximum number of members your current subscription allows. The workflow provided describes the steps to programatically determine the number of assigned users and the maximum number of users allowed for each user type in the subscription and license using ArcGIS API for Python.

Procedure

Note:
The script can be run standalone and in ArcGIS Notebook.
  1. Import the necessary modules and specify the credentials.
from arcgis.gis import GIS
import pandas as pd

#For ArcGIS Online
gis = GIS("<ORGANIZATION_URL>", "<username>", "<password>")

#For Portal for ArcGIS
gis = GIS("https://<machine>.<domain>.com/<web_adaptor_name>", "<username>", "<password>", verify_cert=False)
  1. Assign the license_type properties to the parameter.
licenses = gis.users.license_types
  1. Run a loop to iterate between all user types and obtain the maximum number of users.
for license in licenses:
    print (license["id"], license["name"], license["maxUsers"])
  1. Print the total assigned user types.
user_type_assigned = gis.users.counts("user_type", as_df=True)
print(user_type_assigned)

Below is the full script for Portal for ArcGIS.

from arcgis.gis import GIS
import pandas as pd

#For Portal for ArcGIS
gis = GIS("https://machine_test.arcgis.com/", "username1", "password1!", verify_cert=False)

licenses = gis.users.license_types

for license in licenses:
    print (license["id"], license["name"], license["maxUsers"])

user_type_assigned = gis.users.counts("user_type", as_df=True)
print(user_type_assigned)

Article ID: 000032561

Software:
  • ArcGIS Online
  • Portal for ArcGIS
  • ArcGIS Enterprise 11 0
  • ArcGIS Enterprise 11 1
  • ArcGIS Enterprise 11 3
  • ArcGIS Enterprise 11 2

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options