Select to view content in your preferred language

Assign Location Tracking Licenses with Notebooks

464
2
Jump to solution
10-13-2024 07:31 AM
AFackler_NAPSG
Frequent Contributor

Hello all,

I am creating a script in my hub community on ArcGIS Online to quickly create a bunch of usernames quickly. I have most of it nailed down but each license is given a location sharing license for the Tracker functionality. With this I cannot seem to figure out how I can assign the created usernames location tracking licenses and add them to the tracker view. I have been trying to follow the documentation here https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.admin.html#arcgis.gis.admin.Lic... as well as this https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.tracker.html#locationtrackingm... but so far I have not had any luck with any combination I try. Has anyone done this before and can help out?

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi @AFackler_NAPSG,

Try the following:

from arcgis.gis import GIS

# Variables
agolAdmin = 'jskinner_rats'
agolPassword = '*******'
agolUser = 'fielduser'

# Connect to AGOL
print('Connecting to AGOL')
gis = GIS('https://www.arcgis.com', agolAdmin, agolPassword)

print("Assign Locating Sharing license")
user_license = gis.admin.license.get('ArcGIS Location Sharing')
ent = 'locsharing'
user_license.assign(username=agolUser, entitlements=ent)

View solution in original post

2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi @AFackler_NAPSG,

Try the following:

from arcgis.gis import GIS

# Variables
agolAdmin = 'jskinner_rats'
agolPassword = '*******'
agolUser = 'fielduser'

# Connect to AGOL
print('Connecting to AGOL')
gis = GIS('https://www.arcgis.com', agolAdmin, agolPassword)

print("Assign Locating Sharing license")
user_license = gis.admin.license.get('ArcGIS Location Sharing')
ent = 'locsharing'
user_license.assign(username=agolUser, entitlements=ent)
AFackler_NAPSG
Frequent Contributor

That did the trick perfectly, thanks Jake!

0 Kudos