<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS Online Add-On License Python Script in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-online-add-on-license-python-script/m-p/1657996#M11728</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/805171"&gt;@bennein&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have never tried something like this but here is how it might go...&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## access ArcGIS Online
agol = GIS("home")

## get the License object for ArcGIS Pro
## if ArcGIS Urban is not a part of the ArcGIS Pro entitlemnents
## then it is its own license and you relace ArcGIS Pro with ArcGIS Urban (or the correct keyword)
pro_license = agol.admin.license.get("ArcGIS Pro")

## print out the entitlements for a user you know has access so you
## can get the ArcGIS Urban keyword.
print(pro_license.user_entitlement("USERNAME"))

###############################################################
##   RUN TO HERE FIRST SO YOU HAVE THE ARCGIS URBAN KEYWORD  ##
###############################################################

## get a list of all users as User objects
users = agol.users.search(max_users=10000)

## for each user
for user in users:
    ## revoke the entitlement
    status = pro_license.revoke(
        username = user.username,
        entitlements = "ARCGIS_URBAN_KEYWORD"
    )

    print(status)&lt;/LI-CODE&gt;&lt;P&gt;Inspiration from &lt;A href="https://developers.arcgis.com/python/latest/guide/administering-your-gis/" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Oct 2025 13:23:54 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2025-10-15T13:23:54Z</dc:date>
    <item>
      <title>ArcGIS Online Add-On License Python Script</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-online-add-on-license-python-script/m-p/1657664#M11722</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I administer an ArcGIS Online Organization for a large higher ed environment. ESRI's license/add-on rearranging caused our users to be assigned an add-on license that no longer exists. It's causing issues with access to software. For example, ArcGIS Urban no longer is a stand alone add-on. Our users have the license but since it's still assigned as separate add-on, I have to manually turn off that expired license for Urban to work. This is just one example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've used ArcGIS API for Python before for credit management and I was wondering if there was a way to develop a script to mass turn off an assigned add-on license for users? I have over 7000+ users and the default ArcGIS Online GUI only allows me (as an admin) to turn off the license for 50 users at a time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate any direction with this as I browse the API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 13:07:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-online-add-on-license-python-script/m-p/1657664#M11722</guid>
      <dc:creator>bennein</dc:creator>
      <dc:date>2025-10-14T13:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Online Add-On License Python Script</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-online-add-on-license-python-script/m-p/1657996#M11728</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/805171"&gt;@bennein&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have never tried something like this but here is how it might go...&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## access ArcGIS Online
agol = GIS("home")

## get the License object for ArcGIS Pro
## if ArcGIS Urban is not a part of the ArcGIS Pro entitlemnents
## then it is its own license and you relace ArcGIS Pro with ArcGIS Urban (or the correct keyword)
pro_license = agol.admin.license.get("ArcGIS Pro")

## print out the entitlements for a user you know has access so you
## can get the ArcGIS Urban keyword.
print(pro_license.user_entitlement("USERNAME"))

###############################################################
##   RUN TO HERE FIRST SO YOU HAVE THE ARCGIS URBAN KEYWORD  ##
###############################################################

## get a list of all users as User objects
users = agol.users.search(max_users=10000)

## for each user
for user in users:
    ## revoke the entitlement
    status = pro_license.revoke(
        username = user.username,
        entitlements = "ARCGIS_URBAN_KEYWORD"
    )

    print(status)&lt;/LI-CODE&gt;&lt;P&gt;Inspiration from &lt;A href="https://developers.arcgis.com/python/latest/guide/administering-your-gis/" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 13:23:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-online-add-on-license-python-script/m-p/1657996#M11728</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-10-15T13:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Online Add-On License Python Script</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-online-add-on-license-python-script/m-p/1658033#M11732</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/805171"&gt;@bennein&lt;/a&gt;, if you are still seeing a duplicate license warning in the ArcGIS Online GUI, then you may be able to revoke all of the license in one-go via that warning message. For more details, please see&amp;nbsp;&lt;A href="https://community.esri.com/t5/education-blog/removing-duplicate-add-on-license-messages-in/ba-p/1609466" target="_self"&gt;Removing Duplicate add-on license messages in Education ArcGIS Online Organizations.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Since ArcGIS Urban was previously delivered as part of an application bundle, the ArcGIS Urban Suite (which included CityEngine and Urban), revoking the bundle programmatically is different than for a license. (See the &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.admin.html#bundle" target="_self"&gt;Bundle&lt;/A&gt; class in the ArcGIS API for Python.)&lt;/P&gt;&lt;P&gt;Here's an example that revokes the ArcGIS Urban Suite bundle from all users who currently have it:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Retrieve available bundles for your gis.
bundles = gis.admin.license.bundles

# Extract the bundle for ArcGIS Urban Suite
bundle = [ b for b in bundles if b.properties.name == "ArcGIS Urban Suite" ][0]

# Retrieve list of users who have the bundle
users = bundle.users

# Revoke the bundle from that list of users
bundle.revoke(users)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Also, double-check that you are no longer assigning the ArcGIS Urban Suite via New member defaults.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 14:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-online-add-on-license-python-script/m-p/1658033#M11732</guid>
      <dc:creator>PeterKnoop</dc:creator>
      <dc:date>2025-10-15T14:50:43Z</dc:date>
    </item>
  </channel>
</rss>

