Skip to content

PortalPy Example Usage

Alexander Nohe edited this page Mar 24, 2014 · 1 revision

How to generate an instance of Portal.

import portalpy
PortalAdmin = portalpy.Portal("http://arcgis.com", "MyUserName", "MyPassword")

The response should be a portal object which the user can then access the methods of Portal from. For instance, if the user wished to access all of the users in the organization they could use the following:

Generate a list of all users in the organization.

import portalpy
PortalAdmin = portalpy.Portal("http://arcgis.com", "MyUserName", "MyPassword")
users = PortalAdmin.get_org_users(max_users=1000)
for user in users:
  print user['username'] + " " + user['fullName']

The response should be a listing of all the users and usernames within the organization.