Portal userLicenseTypeId CreatorUT

395
2
Jump to solution
10-17-2022 02:17 PM
AntheaTung
New Contributor III

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

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
EarlMedina
Esri Regular Contributor

Hi,

There's actually a user_type parameter so this is as easy as this:

gis.users.search(user_type='creatorUT')

 

Hope this helps!

View solution in original post

0 Kudos
2 Replies
EarlMedina
Esri Regular Contributor

Hi,

There's actually a user_type parameter so this is as easy as this:

gis.users.search(user_type='creatorUT')

 

Hope this helps!

0 Kudos
AntheaTung
New Contributor III

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

 

 

 

 

0 Kudos