Skip to content

Instantly share code, notes, and snippets.

@cindygis
Created March 23, 2015 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cindygis/8199abd0a36c4cda5bba to your computer and use it in GitHub Desktop.
Save cindygis/8199abd0a36c4cda5bba to your computer and use it in GitHub Desktop.
Prints the list of databases registered with the given ArcGIS Server, along with the connection properties (excluding ENCRYPTED_PASSWORD).
#
# @date 23/03/2015
# @author Cindy Williams
#
# Prints the list of databases registered with the
# given ArcGIS Server, along with the connection
# properties (excluding ENCRYPTED_PASSWORD).
#
# For use in the Python window in ArcCatalog.
#
import arcpy
import os
folder_user = os.environ['USERPROFILE']
folder_arccatalog = "AppData\Roaming\ESRI\Desktop10.3\ArcCatalog"
ags_name = "arcgis on dev01 (admin).ags"
ags = os.path.join(folder_user, folder_arccatalog, ags_name)
for dsi in arcpy.ListDataStoreItems(ags, "DATABASE"):
print dsi[0] + "\n\t" + "\n\t".join(dsi[1].split(";")[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment