Powershell script on SQL agent no longer working
Hi,
I created a powershell script that is scheduled in SQL Agent(2012), it is one of many steps in a process to download and process data. Since Oct 2 this script is no longer executed - on this day Security Update for Windows (KB4522007)
- it appears that the library cannot be loaded when executed from SQL agent - I can execute the script as user logged in on the machine via RDP or a scheduled task in the Windows task scheduler. I suspect that this the access to dll files has been restricted to the SQL agent as a measure of increasing security. How else can I refer to the assembly? Can I move the file(s) to another location that SQL agent has access to?
Below the error message:
Kai
I created a powershell script that is scheduled in SQL Agent(2012), it is one of many steps in a process to download and process data. Since Oct 2 this script is no longer executed - on this day Security Update for Windows (KB4522007)
- it appears that the library cannot be loaded when executed from SQL agent - I can execute the script as user logged in on the machine via RDP or a scheduled task in the Windows task scheduler. I suspect that this the access to dll files has been restricted to the SQL agent as a measure of increasing security. How else can I refer to the assembly? Can I move the file(s) to another location that SQL agent has access to?
Below the error message:
Thanks for any hint what I could do to fix this.PowerShell script. The corresponding line is ' Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Could not load file or assembly 'file:///C:\Program Files (x86)\WinSCP\WinSCPnet.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. '. Process Exit Code -1. The step failed.\
Kai