HOW TO
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.
Note: The script can be run standalone and in ArcGIS Notebook.
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)
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)
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
Get help from ArcGIS experts
Download the Esri Support App