Skip to main content
deleted 74 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

This extends the question scope slightly, but, it might help someone.

If running scripts with a service account, the Pro profile has to be created in C:\Users\user\AppData\Roaming\Esri for it by logging into the machine with the service account and logging into Pro. Then, the service account can call propy.bat offline, which will reference that profile. I did not have to authorize Pro to work offline but did check Sign me in automatically.

ArcPy fails to import when not logged into host machine

(I I also had to grant my service account the ability to run batch scripts. See https://stackoverflow.com/questions/48343993/batch-file-from-scheduled-task-returns-code-2147942401/51499918 file from scheduled task returns code 2147942401).

This extends the question scope slightly, but, it might help someone.

If running scripts with a service account, the Pro profile has to be created in C:\Users\user\AppData\Roaming\Esri for it by logging into the machine with the service account and logging into Pro. Then, the service account can call propy.bat offline, which will reference that profile. I did not have to authorize Pro to work offline but did check Sign me in automatically.

ArcPy fails to import when not logged into host machine

(I also had to grant my service account the ability to run batch scripts. https://stackoverflow.com/questions/48343993/batch-file-from-scheduled-task-returns-code-2147942401/51499918)

If running scripts with a service account, the Pro profile has to be created in C:\Users\user\AppData\Roaming\Esri for it by logging into the machine with the service account and logging into Pro. Then, the service account can call propy.bat offline, which will reference that profile. I did not have to authorize Pro to work offline but did check Sign me in automatically.

ArcPy fails to import when not logged into host machine

I also had to grant my service account the ability to run batch scripts. See batch file from scheduled task returns code 2147942401.

Source Link

This extends the question scope slightly, but, it might help someone.

If running scripts with a service account, the Pro profile has to be created in C:\Users\user\AppData\Roaming\Esri for it by logging into the machine with the service account and logging into Pro. Then, the service account can call propy.bat offline, which will reference that profile. I did not have to authorize Pro to work offline but did check Sign me in automatically.

ArcPy fails to import when not logged into host machine

(I also had to grant my service account the ability to run batch scripts. https://stackoverflow.com/questions/48343993/batch-file-from-scheduled-task-returns-code-2147942401/51499918)