Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Powershell - Modify Server Name in SQL 2005 SSIS Connections

By Mandeep Dulai,

On a current project I was working on, my task involved setting up a test environment which involved copying 60 SSIS packages from the production server to a test server. The problem at hand was the production server name was specified in the SSIS package connections and I did not want to go through each package manually and change the server name. Also, each package contained multiple connections including a connection to a DB2 production server. I'm a newbie to powershell and after reading many articles on the internet, I decided to automate the process using a powershell script.


  • Install Powershell v2.0 -
  • Install SQLPSX -


The powershell script takes a number of parameters:

$sourceSQLServerName: Production SQL Server to get a copy of SSIS packages

$destinationSQLServerName: Test SQL Server to load modified SSIS packages

$MSDBFolderName: Folder name within MSDB where SSIS packages are stored

$oldSQLServerName: Old SQL Server name that will be replaced by new name in SSIS package connections

$newSQLServerName: New SQL Server name that will replace old name in SSIS package connections

$oldDB2ServerName: Old DB2 Server name that will be replaced by new name in SSIS package connections

$newDB2ServerName: New DB2 Server name that will replace old name in SSIS package connections

$oldFileConnectionPath: Old file path that will be replaced by new file path in SSIS package connections

$newFileConnectionPath: New file path that will replace old file path in SSIS package connections

After the script is run, you can double check the modified SSIS packages which are copied to the local file system to verify connections were updated correctly.



Total article views: 621 | Views in the last 30 days: 4
Related Articles


How to replace a value


Server Connection Timeout

Server Connection


ISQLW Replacement

2005/8 deleted ISQLW.EXE small footprint utility with no real replacement


changing the connection password hrough another package

changing the connection password through another package


Urgent: Need Help to change server connection of SSIS packages

Need Help: For Changing server connection in SSIS for deploying into production without opening each...


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones