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?
Solved! Go to Solution.
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)
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)
That did the trick perfectly, thanks Jake!