python api portal users

1313
4
05-15-2019 09:46 AM
MarkJones7
Occasional Contributor

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()

4 Replies
HåkonDreyer
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

MarkJones7
Occasional Contributor

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

0 Kudos
HåkonDreyer
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

MarkJones7
Occasional Contributor

Sweet! Thanks again.

0 Kudos