Select to view content in your preferred language

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

247
2
11-05-2024 09:56 AM
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
2 Replies
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
Mike_Quetel
Frequent Contributor

Thank you for this suggestion.  The dataframe returned only shows entitlements for 'desktopBasicN' which are the add-on licenses for Creator user types.  This is the data I can already get using the methodology above.  Missing from the dataframe are entries for GIS Professional Advanced and GIS Professional Standard.  As far as I can see, this method has the exact same limitation as my original approach.  This is on Enterprise v11.1   Is this a bug or known limitation or am I doing something wrong?

The complete dataframe returned:

report dataframe.png

The user licenses available:  

license.png

 

0 Kudos