Select to view content in your preferred language

Logging ArcGIS Pro usage (creatorUT with add-on license vs GISProfessionalStdUT) via Python

206
1
11-05-2024 09:56 AM
Labels (1)
Mike_Quetel
Frequent Contributor

When our users were licensing pro as a named user with an add-on license, we could query the portal for users who have that add-on license and access when they last used it, determine if it was checked out, etc.  Something like this:

arcgisProLicense = gis.admin.license.get('ArcGIS Pro')
entitlement = arcgisProLicense.user_entitlement(user.username)
if entitlement and 'entitlements' in entitlement:
  hasProLicense = "TRUE"
  if 'lastLogin' in entitlement:
    proTimestamp = entitlement['lastLogin']
    if (proTimestamp > 0):
      proLastUsed = datetime.fromtimestamp(proTimestamp / 1000)
  if 'disconnected' in entitlement:
    if (entitlement['disconnected']):
      proLicenseCheckedOut = "TRUE"
    if 'disconnectedInfo' in entitlement:
      proLicenseCheckOutStartDate = datetime.fromtimestamp(entitlement['disconnectedInfo']['disconnectedSince'] / 1000)
      proLicenseCheckOutEndDate = datetime.fromtimestamp(entitlement['disconnectedInfo']['disconnectedUntil'] / 1000)

 

With the switch to user types like 'GISProfessionalBasicUT' and 'GISProfessionalStdUT', this entitlement is not available from the license.  Sure it becomes implicit that the user does have access to a pro license, but how would I access the metadata that is available for Creators with an add-on license.  I still want to be able to log when software was last used, etc.


Thank you in advance.

 

 

0 Kudos
1 Reply
NanaeAubry
Esri Contributor

Have you tried using the report property on the License:

`arcgisProLicense.report`

 

This returns a panda's dataframe that reports all the entitlements for this license. It has a column called: Users

You can get information from this column on who has this entitlement and when it was last used.

0 Kudos