You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
def getAllUsers(admin, portalId=None):
"""
returns all the users for a given AGOL
Inputs:
portalId - unique id of the portal
admin - manageorg.Administration object
Output:
returns a list of the users
"""
start = 1
num = 100
portals = admin.portals
pp = portals.portal(portalID=portalId)
count = 0
nextStart = 0
results = []
while nextStart > -1:
users = pp.users(start=start + (num * count),
num=num)
results = results + users['users']
count += 1
nextStart = users['nextStart']
del users
return results
all_users = getAllUsers(admin=admin)
Iterate through all content in each folder for each user
for currentUser in all_users:
print("Looking at user: %s" % currentUser.username)
uc = currentUser.userContent
for folder in uc.folders:
uc.currentFolder =folder['title']
print (' --------------------------------------------')
print (" In folder: %s" % folder['title'])
for item in uc.items:
print(" - %s" % item.title)
The text was updated successfully, but these errors were encountered:
Python code
federated portal site.
import arcrest
#login to the site
username = 'xxxxx'#Username
password = 'xxx'#password
org_url='https://soa-nbo-gis07:7443/arcgis/sharing/rest'
tokenUrl='https://soa-nbo-gis07:7443/arcgis/sharing/rest/generateToken'
sh = arcrest.PortalTokenSecurityHandler(username=username, password=password,org_url=org_url,token_url=tokenUrl)
admin = arcrest.manageorg.Administration(securityHandler=sh)
content = admin.content
Get a list of all users
def getAllUsers(admin, portalId=None):
"""
returns all the users for a given AGOL
all_users = getAllUsers(admin=admin)
Iterate through all content in each folder for each user
for currentUser in all_users:
print("Looking at user: %s" % currentUser.username)
uc = currentUser.userContent
for folder in uc.folders:
uc.currentFolder =folder['title']
print (' --------------------------------------------')
print (" In folder: %s" % folder['title'])
for item in uc.items:
print(" - %s" % item.title)
The text was updated successfully, but these errors were encountered: