2

I want to execute a SSIS package on ISServer via PowerShell. I used the script found on microsoft page. This doesn't work out for me. I want to pass a connectionstring but not to assign to the connectionmanager but just as a variable string. In the connectionstring there are \ and ; present and powershell sees this as a new option. I just want it to be seen as a whole string.

I've tried everything, adding "\" and \"" like some websites suggested, used instead of \, put double quotes, put ' quotes, nothing works. Always getting the error optionMyServer\MyServer;Initial is not valid. I can't removeMyServer\MyServer` because connection is to that instance.

The Connectionstring is assigned via a changing variable. So variable contains Data Source=MyServer\Myserver;Initial Catalog=SQL_MyArchive;Provider=SQLNCLI11;Integrated Security=SSPI;

dtexec /ISSERVER  "\SSISDB\Test\Test.dtsx" /SERVER "MYServer" /ENVREFERENCE 8 /Par "$Package::ConnectionSource";`""Data Source=MyServer\Myserver;Initial Catalog=SQL_MyArchive;Provider=SQLNCLI11;Integrated Security=SSPI;"`"

How can i let the system see the whole connectionstring as a string? "" and "" does not work.

Hadi
  • 36,233
  • 13
  • 65
  • 124
Lapken
  • 21
  • 1

1 Answers1

0

use the following syntax to pass a connectionstring to a variable (you missed a \")

/Par "$Package::ConnectionSource";\""Data Source=MyServer\Myserver;Initial Catalog=SQL_MyArchive;Provider=SQLNCLI11.1;Integrated Security=SSPI;"\"
Hadi
  • 36,233
  • 13
  • 65
  • 124