I am trying to see how to query our ARCGIS Online account to get a list of users and their Last Login Date. From there I want to grab the users that have not logged in say for 40 days. And then create a new list and do something with it like email them etc.
I can do something like this to get a full count of the users but don't know how to query for the Users and their Login Date....
Any thoughts?
from arcgis.gis import GIS
import arcgis
gis = GIS("https://xyz.maps.arcgis.com", "usernamne", "passaword") # set first arguement to your Portal or AGOL
users = arcgis.gis.UserManager(gis)
# get the total number of users in your AGOL account provided you have administrative priveledges
totalUsers = users.counts('user_type', as_df=False)[0]['count']
print(totalUsers)