SQLTeam.com | Weblogs | Forums

Execute .bat file on remote server from Agent job on Azure VM


Trying to run below syntax inside SQL Agent job on Azure VM pointing to on-prem VM. .bat file when executed from OS works successfully every time - just fails when ran from SQL Agent although same credentials used.

Have set up Credential, proxy for CmdExec, Agent job to use CmdExec and Proxy. Latest error we obtained was permissions, suggesting the proxy account is not being used as we know it works when the .bat file is executed direct from the OS.

NET USE W \\CTI\bin\Reports.exe -l "LoginName" -p "1234" -batchmode "something" -CSV -dir "F:\DataWarehouse\Data" /PERSISTENT:YES

Any ideas?