AnsweredAssumed Answered

How to create users/roles for ArcGIS Server using ArcPy?

Question asked by geoffreywestgis on Nov 25, 2014

I would like to automate this process using ArcPy.

 

I am following the documentation found here;

ArcGIS Help 10.1

 

I am scripting this from the ArcMap Python Window. My error is;

 

Runtime error

Traceback (most recent call last):

  File "<string>", line 231, in <module>

  File "<string>", line 20, in main

EOFError: EOF when reading a line

 

 

 

 # This script creates a bank of users and roles given a comma-separated text file
... #  They should be listed in the following format and saved in a file with a .txt extension:
... #
... #  User,Role,RoleType,Password,EMail,FullName,Description
... #  John,Admins,ADMINISTER,changeme,johndoe@esri.com,John Doe,Server admin
... #  Jane,Publishers,PUBLISH,changeme,janedoe@esri.com,Jane Doe,Server publisher
... #  Etc.
... 
... import json, urllib,httplib
... 
... # For system tools
... import sys
... 
... # For reading passwords without echoing
... import getpass
... 
... 
... def main(argv=None):
...     # Ask for admin/publisher user name and password
...     username = raw_input("myUserName:")
...     password = getpass.getpass("myPassword:")
... 
...     # Ask for server name & port
...     serverName = raw_input("http://myServer/arcgis/admin/login")
...     serverPort = 6080

Outcomes