Hello,
Is there a way to search for all the users that have the userLicenseTypeId = CreatorUT in Portal?
My code returns nothing:
import arcgis
import time
from arcgis.gis import GIS
gis = GIS("https://xyz.com/", username="admin", password="xxxx", verify_cert=False)
print("Connection Check : Connected")
myLicType = [user for user in gis.users.search(query=user.userLicenseTypeId)] << returns blank
Thanks !
AT
Solved! Go to Solution.
Hi,
There's actually a user_type parameter so this is as easy as this:
gis.users.search(user_type='creatorUT')
Hope this helps!
Hi,
There's actually a user_type parameter so this is as easy as this:
gis.users.search(user_type='creatorUT')
Hope this helps!
Thank you @EarlMedina this did the trick!
For others FYI:
import arcgis
import time
from arcgis.gis import GIS
gis = GIS("https://xyz.com/", username="admin", password="xxxx", verify_cert=False)print("Connection Check : Connected")
All_users = gis.users.search(user_type='creatorUT')
for one_user in All_users:
user = gis.users.get("{}".format(one_user.username))
#Ignore the System Users
if one_user.username.startswith("esri"):
pass
#Ignore the UNOwner Users
elif one_user.username.endswith("UNOwner"):
pass
else: #do something with each user