The information provided in this post is provided as-is, this is most likely unsupported, proceed at your own risk.

There are times when you may need to move the source files for your packages from one location to another.  Maybe your server is running low on space, or you just want to reorganize things a little bit.  Regardless, manually updating all of your packages with a new source would be a very tedious task.  Provided with this blog post is a script that will make the necessary changes and create a log file so you can easily see what was changed. 

If you are the original creator of the script that I modified, thank you, as I’m not sure where I got the script from, it was something I had laying around and then I modified to take advantage of MDT’s logging capabilities.

I’ve taken ZTIUtility.vbs from MDT and modified it a little bit to do what I need, and then my script utilizes the logging functions of ZTIUtility to create a log file for you that shows the status and results of the changes. 

Modifying The Script For Your Environment

In order for the script to function properly, we will need to modify a few items in the script for your environment. 

image

First, set the old server path and then the new server path, this could be just the server, or this could possibly be a share path as well.  Basically whatever you want to replace goes here.

Also, set the server you want to connect to to make the changes. 

Running The Script

Place the script files (ZTIUtility.vbs and configmgr-updatepackagesourcepaths.wsf) in a folder (I use “Scripts” in this example), and then run the following command line to run them. You will need the modified version of ZTIUtility included with the download, otherwise, it should work with any copy of ZTIUtility, however the logs will show up under \MININT\SMSOSD\LOGS most likely.

cscript.exe ConfigMgr-UpdatePackageSourcePaths.wsf

image

You can also just double-click on the script if you are viewing it with windows explorer.

image

After the script runs, you will have a “Script_Logs” folder on the root of C:.

image

Open up the “ConfigMgr-UpdatePackageSourcePaths.log” to view the results. “BDD.log” will also have the same information.

image

Here you can see that we modified the Package “Test Package” and changed the source from \\2008-test to \\2008-configmgr. I have coded the script to show the package name as a Warning type message so it’s easy to find the packages in the log file.  You will be able to see every package that was updated and what the original path and the new path is now.

I would also recommend that you view the changes in SQL to quickly see all the packages.  This can be accomplished through SQL Management Studio by running the following query.

select * from v_package
order by PkgSourcePath

I sorted the query by the Package Source Path (PkgSourcePath), and then you can easily see where everything is located. Here we can see our Test Package amongst other packages with the new source path we specified in the script file.

image