I use this script right now:
import os, arcpy directory = r"C:\Project" for root, dirs, files in os.walk(directory): for myFile in files: fileExt = os.path.splitext(myFile) if (fileExt == ".mxd"): fullPath = os.path.join(root, myFile) print myFile myMap = arcpy.mapping.MapDocument(fullPath) analysis = arcpy.mapping.AnalyzeForMSD(myMap) for key in ('messages', 'warnings', 'errors'): print "----" + key.upper() + "---" vars = analysis[key] for ((message, code), layerlist) in vars.iteritems(): print " ", message, " (CODE %i)" % code print " applies to:", for layer in layerlist: print layer.name, print
It runs on many project mxds. And every time it analyzes a mxd file I`m asked the connection dialogue and have to enter the connection details.
Is there a way to open a database connection that is valid for all mxd?