October 2017
Intermediate to advanced
382 pages
11h 26m
English
In Chapter 7, Scripting Administrative Tasks, we used PortalPy to pull user information out of our Portal. We can do the same thing with the ArcGIS API for Python, but in a modern, Pythonic fashion. Let's look at how we can easily pull user information from Portal:
import collections
import time
import pandas as pd
from arcgis.gis import GIS
After we've imported the libraries we will need, we create a connection to our GIS and then perform a search for users whose username does not begin with esri_. Note how we use the bang (!) symbol as a NOT operator:
gis = GIS("https://www.masteringageadmin.com/portal",
"portaladmin", "somepass")
all_my_accounts = gis.users.search('!esri_')
What we do next should look familiar, as we ...
Read now
Unlock full access