I am currently trying to automate the steps of publishing a map service and create scheduler tasks to allow the maps to publish automatically. Currently my code creates and save the new mxd, Creates a service definition draft of the service, analyzes the draft for errors and if there are no errors the service is published to the arcgis server manager. The script works as expected running the script as a .bat file. However in the Windows Task scheduler the script fails at the line that creates the service definition draft.
The task is already set to "Run with Highest privileges" and "Run whether user is logged on or not"
Does anyone know how to make the script run in the task scheduler?
You can use VBSCRIPT and paste into field calculator
CStr([LATITUDE]) + CStr([Longitude])
Which version of python are you running the script with? This may be unrelated, but I had a problem where the arcpy.StageService_server() function was not working with 64 bit Python 2, but when I switched to 32 bit Python 2 it worked.
It is my understand that when using Task Scheduler all file paths need to be UNC instead of letter network drives. Thus in line 26 instead of
con = 'D:\Temp\ArcGIS Connection\ArcGISAdminConnection.ags'
it should be
con = '\\Server\Temp\ArcGIS Connection\ArcGISAdminConnection.ags'
This is discussed for a slightly different script at Stack Overflow. I would check the rest of the script for any other mapped network drive paths. Once I put in UNC paths that solved my similar problem.