python api portal users

574
4
05-15-2019 09:46 AM
Highlighted
New Contributor III

Good Afternoon,

I am able to use the python api to get a list of the users in my portal, but it isn't all of them. I returns 100 but there are actually 172. For someone that I know is a user, but isn't in the return list, I can still find them when doing a search by their account name. Just wondering if I am missing something.

The code i use to get the list of uses is:

gis.users.search()

Reply
0 Kudos
4 Replies
Highlighted
Esri Contributor

Hi, Mark

The API returns 100 as a default. Set the max_users= parameter to override.

_users = gis.users.search(exclude_system=True, max_users=1000)

Doc

Highlighted
New Contributor III

classicly simple! thank you kindly! BTW, how did you get that nice print out of the parameters?

Reply
0 Kudos
Highlighted
Esri Contributor

That's one of the niceties of Jupyter. Just add a question mark to a command and you get the documentation.

Screenshot from Jupyter

Highlighted
New Contributor III

Sweet! Thanks again.

Reply
0 Kudos