Home Forums Programming Powershell Powershell script being run as SQL agent job RE: Powershell script being run as SQL agent job

  • MickyD (7/10/2013)


    opc.three (7/10/2013)


    Is the server 64-bit? Does the server have the Excel Object Model installed either via Office or VSTO? How are you kicking off the script, in a PowerShell step-type or using powershell.exe in a CmdExec step-type?

    HI , the machine is 64 bit and assume has Excel object model installed as it runs from powershell gui fine. As long as Excel.exe is still not running.

    Trying to Kick it off via a SQL job. Never worked so far , but script does work in gui as long as above is met.

    Is the PowerShell GUI a 64-bit app? It might be a 32-bit app in which case it would be accessing 32-bit Excel objects. Whereas when running through SQL Agent it is running as a 64-bit process. Bit-ness differences are a very common reason why apps that use Office objects work great when debugging and fail when run on a server.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato