I have a PowerShell script with logic to transfer data from 1 SQL Server to another using the Bulk Copy command.
In Powershell Version 5, I have installed the SQLServer module to do the above activity.
When I execute the Powershell script from my local machine via the PowerShell tool it is successful. Similarly, when I executed the same command from the remote server (Windows 2012 R2) again via the PowerShell tool where my account has admin access it was successful.
But when I am calling the same command from the Jitterbit (ETL) tool pointing to the above Remote Server which uses Service Account it's failing with the below error
Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies
I did check a couple of sites for the above error and almost everywhere it's suggested to install SharedManagementObjects.msi and SQLSysClrTypes.msi so I did install it on Remote Server with a version specific to my MSSQL 2016 but still the same issue.
Also checked directory (C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.1.18230) there also I can see Microsoft.SqlServer.BatchParser.dll file exists.
So now I am not sure why this issue exists, it seems like permission issues for Service Account, So based on my limited knowledge of PowerShell I have set the below permissions but still no use, Can someone please help me with this issue.
UPDATE
The above error is resolved, but the script is not executing when executed from Jitterbit, no errors but it's just not executing, however, it is executing if I log in to the remote server with my login and execute it from the PowerShell tool itself. my guess is still the same it has to do something with permissions for the service account which is blocking the script to execute.