I have a Windows command file that successfully executes an ArcGIS arcpy Python script when run manually or via Task Scheduler . But when executed by the EM Agent, arcpy doesn't recognize the SDE connection string file as a workspace for connecting to the geodatabase. The manual execution on the server uses the same login as the EM Agent.
I have verified all the environment variables for the EM Agent are the same as those for running natively on the server. I then used arcpy to describe the file type using both execution methods.
DescribeFile.py
import os
import sys
import arcpy
desc arcpy.Describe("D:\\Test\\Compress\\database_login.sde")
print desc.dataElementType
Manual output of: python.exe DescribeFile.py >> DEWorkspace
EM Agent output of: python.exe DescribeFile.py >> DEFile
I have little experience with Python, but years of experience with the EM Agent. I have been unable to find anything related that was helpful on Oracle Support, ESRI support, or general internet searches.