Have two powershell scripts that I edited from XP to run in Win Server 2k8 R2.
They run fine when executed by manually in powershell, but if scheduled and run as domain admin, they perform all file operations they're supposed to; except they don't do a start-process that sends the file to the SFTP site it needs to go to.
They're launched by running powershell.exe with arguments as such:
-noprofile -ExecutionPolicy Bypass -file C:\Users\administrator\Documents\script1.ps1
Again, like I mentioned previously, they run fine and launch the start-process
as requested if you manually run them and only run the file operations if they're scheduled and skip the start-process.
The start-process
is as follows:
start-process -FilePath "c:\Program Files (x86)\Tumbleweed\STClient\stclient.exe" -ArgumentList "httpsu://www.securesiteexample.org/incoming/ $filename /prefNoAskSched /hidden /log /Remote-Site return /quitWhenDone"
What am I missing?
In your Task, go to Actions pane, edit and remove anything from start in field.
Add some code to check to make sure the process is getting launched.