HOW TO
New members can be added to ArcGIS Server when required. For example, if a new member joins the organization, they can be assigned custom roles according to the organization's requirements. To add new members and roles, administrators must access ArcGIS Server Manager. Refer to ArcGIS Server: Manage users in Manager for more information.
Alternatively, ArcGIS API for Python can be used because it allows administrators to add new members with custom roles without accessing ArcGIS Server Manager. This article provides the workflow.
from arcgis import GIS
gis = GIS("https://<machine>.<domain>.com/<web apdaptor name>", "username", "password") print(' server: ' + gis.properties.name) print(' server: ' + gis.properties.username) print(' server: ' + gis.properties.role)
gis.users.roles.all(max_roles=50) roles = gis.users.roles.all(max_roles=50)
print(roles[2].name) print(roles[2].role_id)
gis.users.create(username='username', password='password', firstname = 'Peter', lastname='Parker', email='PParker@test.com', description='Test user', role='sadc65er16c1e5f', user_type='Creator')
The code block below demonstrates the full script.
from arcgis import GIS gis = GIS("https://test.esri.com/arcgis", "username", "password") print(' server: ' + gis.properties.name) print(' server: ' + gis.properties.username) print(' server: ' + gis.properties.role) gis.users.roles.all(max_roles=50) roles = gis.users.roles.all(max_roles=50) print(roles[2].name) print(roles[2].role_id) gis.users.create(username='username', password='password', firstname = 'Peter', lastname='Parker', email='PParker@test.com', description='Test user', role=roles[2].role_id, user_type='Creator')
Get help from ArcGIS experts
Download the Esri Support App