I guess most of you that are reading this post have been in a situation where you were dealing with some sort of ConfigMgr migration project. After objects have been migrated, you’re often faced with the dilemma of manually updating the content source locations for e.g. Applications and Packages. Today I’m proud to announce the release of my next tool aimed to speeding up any migration process by being able to match and replace portions or a simple server name in the content source location of any object type.
Download the tool
I’ve made the tool available in our GitHub repository.
This tool is written in PowerShell and the minimum required version is 3. For updating the content source location of any Deployment Types for Applications, access to certain DLL’s is required. These files are available when the ConfigMgr console is installed on the system the tool is being executed on. For all other object types like e.g. Packages or Boot Images, there’re no requirements. You’re able to resize this tool to get a better view of the data grid view, simply just drag in any of the corners as you’d normally do.
When you first launch the tool, you’ll see that there are two text boxes called Match and Replace. The idea is to enter a match pattern in the Match text box that will be used by the tool for matching against the existing content source location of the select object type. As for the Replace text box, enter here what you want the Match pattern to be replaced with. If the pattern entered in the Match text box does not yield any results, the data grid view will not contain any information, meaning you’re not able to update any content. The tool is also capable of checking if there’s any associated content with the objects of the select object type. When for instance a match is found for an object, and the object has content associated, it will be added to the data grid view called Content Source information. You’re also able to select to copy the content source files from the existing location to the updated location for each object that the tool is instructed to process. If there’s any matched object in the data grid view that you do not wish to update, simply just remove the check mark for that object.
When running this tool, execute it elevated (with Administrative rights) on the Primary Site server where you want the objects content source location to be updated. It’s not been tested to run this tool remotely, although it should most likely run without any errors given that your system for fills the requirements.
Example of usage
Let’s pretend that you’ve migrated a couple of Packages from either a ConfigMgr 2012 or ConfigMgr 2007 source hierarchy called CM01 and only want to update a single package, for testing purposes. Your new Primary Site server is called CM02. Your existing content library on CM01 has been shared as:
All of the content for your Packages are stored in:
In this scenario, the Packages have been migrated to CM02 and you’d like to update the content source location to reflect the new server name. We’re assuming that you’ve copied all of the content source files with the same structure over to the CM02 server, sharing it with the same name like Source$.
- Execute the tool on your new Primary Site server called CM02 with elevated rights and by specifying the Primary Site server name for the SiteServer parameter.
- In the Match text box, enter \\CM01\Source$. For the Replace text box, enter \\CM02\Source$.
- In the Options section, select Package as the desired object type.
- Click on Validate to start the validation process where the tool check if there’s any objects matching the pattern and that are eligible for a content source location update.
- Once you’ve clicked on the Validate button, the tool connects to the SMS Provider and yields the eligible objects in the Content Source Information data grid view.
- Deselect the objects that you don’t want to update and click on the Update button.
- The tool will not start updating the two objects that have been selected. It will output in the Log Information text field if it was either successful or an error occurred.
Now the two selected objects are updating and can be verified in the ConfigMgr console. I showed you this example as a way of verifying that it works in your environment. Once you’ve tested it, you should be good to go for running it on a broader scale.