I am trying to automate an sftp connection using ps script. When i run the ps script under my user - it runs ok, when i run under service user the script fails at session.open command.
In the script i have specified the username and password for user to connect to sftp, but i thing when the script runs under service user configuration is looking in user profile for .rnd file.
How could i run the script using a user that does not have this file?
When i run the windows task under my user it creates the session log (attached). When i run under service username it does not create any session log file. Is there any configuration parameters i have to add into the script? I have read about .ini file - but i am not sure how to use it
Does your PowerShell logging work? (LogWrite calls)
If they do, show us that log too. But first, make sure you add exception handling to your script and log the exceptions too. See also the official PowerShell example (the try...catch block):