Open hughespc opened 7 years ago
What version of Python are you using?
Sent from my Verizon Wireless 4G LTE DROID
Version 10.5
Sent from my iPad
On 30 May 2017, at 00:05, Michael Miller notifications@github.com<mailto:notifications@github.com> wrote:
What version of Python are you using?
Sent from my Verizon Wireless 4G LTE DROID
- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Esri/ArcREST/issues/341#issuecomment-304730565, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE2pN8W0NcxWAkovFdYhDgn7m8Ex4wMfks5r-zMrgaJpZM4NpNa7.
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)