Hey Tobias,    Even though the samples don't use the Network Analysis Service capability, the exact same concept applies. You basically just change the soe value to 'NAServer'. The code essentially parses the XML in the draft and sets the "enabled" value for the Network Analysis SOE from "false" to "true".     The following code allowed me to publish a completely functional NA service from an MXD that I have. I used the sample from the Sample 3 in the Help documentation from the CreateMapSDDraft help to build this.     import arcpy, os import xml.dom.minidom as DOM  print "Establishing environment" workspace = r"C:\temp\enableNA" mxd = arcpy.mapping.MapDocument(os.path.join(workspace,"enablenatest.mxd")) svrconnection = os.path.join(workspace, "svrconnection.ags") outsddraft = os.path.join(workspace,"service.sddraft") draftfinal = os.path.join(workspace,"draftfinal.sddraft") outsd = os.path.join(workspace,"naservice.sd")  print "Creating initial draft" arcpy.mapping.CreateMapSDDraft(mxd, outsddraft, "PythonNaTest","ARCGIS_SERVER",svrconnection) soe = 'NAServer'  print "Enabling Network Analysis in the draft" # Read the sddraft xml. doc = DOM.parse(outsddraft) # Find all elements named TypeName. This is where the server object extension (SOE) names are defined. typeNames = doc.getElementsByTagName('TypeName') for typeName in typeNames:     # Get the TypeName whose properties we want to modify.     if typeName.firstChild.data == soe:         extension = typeName.parentNode         for extElement in extension.childNodes:             # Enabled SOE.             if extElement.tagName == 'Enabled':                 extElement.firstChild.data = 'true'                                          # Output to a new sddraft. f = open(draftfinal, 'w')      doc.writexml( f )      f.close()  print "Staging Service" arcpy.StageService_server(draftfinal, outsd)  print "Publishing to Server" arcpy.UploadServiceDefinition_server(outsd,svrconnection,"PythonNATest")      
						
					
					... View more