In Portal you can see the ArcGIS Pro license activity through this button:
My simple question is, can you obtain this ArcGIS Pro activity through the REST API for python?
With the following code you can get what licenses are assigned to what user and when they had their last login:
gis.admin.license.get('ArcGIS Pro')
print(agpro.all())
returns
[{'username': 'name 1', 'lastLogin': 1706174509800, 'disconnected': False, 'entitlements': ['arcgispro-extension1', 'arcgispro-extension2', 'arcgispro-extension3']},{other users with arcgis pro extension licenses},{'username': 'username1', 'lastLogin': 1706098700941, 'disconnected': False, 'entitlements': ['desktopAdvN']}]
I'm also looking for a very similar script. Sadly, Esri does not provide any documentation on it currently..