Hi, How could we retrieve just usernames from
gis.users.search()
list? I am trying to compare users between Azure active directory and built-in users. I just need the usernames but not the entire list comprehension. Thanks
-Naresh Aligeti
python api portal
Solved! Go to Solution.
Naresh,
Try
[user.username for user in gis.users.search()]
which should return you a list of usernames instead of User objects.
Naresh,
Try
[user.username for user in gis.users.search()]
which should return you a list of usernames instead of User objects.
That worked, thanks Atma.
Thanks for the posted thread, this is helping me as well. I have a question to add to Naresh's question, I am having a hard time finding an example.
I need a list of user emails from a specific role in our Org. The added query parameter is not selecting users in the 'UMN Student' role, all users are returned:
users = gis.users.search(query='role: UMN Student')
[users.email for users in gis.users.search()]
Any tips for a newbie? Thanks!
Kate
I have have a partial answer to my question now, I need to query the roles we have created by using the role ID that Esri designates when created. Anyone know how to determine the role ID without have to contact Esri support?
Thanks-
Kate