I am trying to export list of all Portal Users with username, email, role, level, creation time, etc.
I'm using ipynb in ArcGIS Pro and able to generate a csv file. However, I only have the User Level and the User Role, no User Type like(Viewer, Fieldworker and Creator) on the extracted reported.
Do you know the correct "keyword" to put on the script to have these details?
tried this below but only gives me : arcigsonly for the result.
'User_type': [usr:userType for usr in users],
this is the script I am using,
Hi, Wondering if you ever figured this out? I'm using the code below, but I can't figure out how I can limit my output to just one role (Role = Viewer).
from arcgis.gis import GIS
gis = GIS("<Portal URL>", "<UserName>", "<Password>", verify_cert=False)
outputFile = r"<Output File Location>"
users = gis.users.search('*', max_users=15000)
with open(outputFile, 'w', newline='') as ResultFile:
wr = csv.writer(ResultFile)
header = 'Username', 'Role', 'Email'
for user in users:
UserRow = user.username, user.role, user.email