Scripting Portal for ArcGIS administration

Scripting your Portal for ArcGIS administration allows you to execute common tasks at scheduled times and automate them if desired. It also reduces the chance of making mistakes when performing a complicated or repetitive task. Typical administration workflows that benefit from scripting include:

All administrative tasks in the portal are ultimately executed through the ArcGIS REST API. The API can be invoked from any scripting or programming language that can make HTTP requests.

Portal for ArcGIS includes ready to use command line utilities and Python scripts to help you get started with scripting the administration of your portal. By understanding how the ArcGIS REST API works, you'll be able to expand on the provided samples and create your own scripts.

Portal for ArcGIS command line utilities

A small set of command line utilities are included to help you perform common administrative tasks. The utilities must be run on the machine hosting the portal. They are ready to use and do not require any programming knowledge. See Portal for ArcGIS command line utilities for details.

Sample Python scripts

Portal for ArcGIS includes some sample Python scripts that expand on the capabilities provided through the command line utilities. Unlike the command line utilities, you can run these scripts from any machine that has been configured with the Python environment. The scripts have been written so you can run them easily with minimum knowledge of Python. These scripts can be executed as is, or you can also use them to learn how to interact with the REST API, customize them, or even create your own. See Sample Python scripts for details.

PortalPy

PortalPy is a Esri Python module that helps you streamline the creation of complete administrative tasks. PortalPy provides a collection of high level Python classes that hide the complexities of working directly against the REST API. Using PortalPy requires some level of Python programming knowledge, but provides the most productive environment for automating the administration of your portal. As with the Python sample scripts, you can access the source code to extend PortalPy if desired. See Scripting administrative tasks with PortalPy for details.

The ArcGIS REST API and its relationship to Portal for ArcGIS

The ArcGIS REST API includes resources and operations for administering Portal for ArcGIS. You can invoke every administrative task that the portal supports through the API. In fact, all administration tools provided with ArcGIS, including ArcGIS for Desktop and the Portal for ArcGIS website, leverage this API.

The API can be invoked from any language that can make a web service call, such as Python, Java, JavaScript, PowerShell, C#, Ruby, Scala, Perl, and others. Examples provided in this help use Python. You do not need any Esri software installed to run a script that uses the API.

To learn more, see Scripting with the ArcGIS REST API.

5/5/2015