Created
March 23, 2015 09:19
-
-
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# @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