Select to view content in your preferred language

Confirm Named User License Token Refresh

312
3
02-03-2026 07:32 AM
JeffreyThompson2
MVP Frequent Contributor

We are transitioning to Named User Licensing and have discovered a known issue regarding running scripts on a headless account with a Named User License. In order to keep the license fresh, ArcGIS Pro must be opened once every 15 days or the token will expire and the scripts will stop working. We found a helpful little script by ESRI support that automatically opens and closes Pro for this exact purpose and set it up to run weekly with Windows Task Manger. https://support.esri.com/en-us/knowledge-base/how-to-automate-arcgis-pro-launch-and-shutdown-to-refr....

But, here's the question: How do you know the light goes off in the refrigerator when you close the door? Is there some way to confirm that the Named User Token is actually being refreshed before the scripts start failing?

GIS Developer
City of Arlington, Texas
0 Kudos
3 Replies
JeffSilberberg
Frequent Contributor

in the script instead of the error handler 

 except Exception as e:
        print(e)

 

Replace print(e) with a function to send an email -  

https://community.esri.com/t5/python-questions/send-email-using-python/td-p/1374622

 

 

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

I thought adding an email, but it would really only confirm that the script is running and/or failing. It wouldn't actually confirm if the token is being refreshed.

GIS Developer
City of Arlington, Texas
0 Kudos
JeffSilberberg
Frequent Contributor

 

I think you just need to go a little deeper and evaluate the return code(s). 

 ArcGIS Pro.exe return code bad user token

An "ArcGIS Pro.exe return code bad user token" (often error 498 or 499) indicates an expired, invalid, or missing authentication token, usually when accessing ArcGIS Online/Enterprise services or license activation.

 

0 Kudos