Configuration Manager Powershell: Changing Package Source Location Part 2


Hello Everyone!

This is a follow up to a blog I posted previously, Changing Package Source Location

I was recently on-site with another customer that was migrating from an existing Configuration Manager 2012 environment to a new Configuration Manager 2012 R2 environment.  We needed to move their source files and update source locations not just for Packages this time, but for Applications, Drivers, and Driver Packages. 

This post will focus on the commands that I used (similar to the previous blog) to change the source path for the Drivers and Driver Packages. 

Like in the previous post, we will need to start by accessing the Configuration Manager PowerShell provider

Now, like before, we want to export the current data to a CSV file so when can manipulate it

For Drivers:

Get-CMDriver | select LocalizedDisplayName, ContentSourcePath, CI_ID | Export-Csv $home\documents\Drivers.csv

For Driver Packages:

Get-CMDriverPackage | select Name, PkgSourcePath, PackageID | Export-Csv $home\documents\DriverPackages.csv

Now you can open the CSV files with notepad (or any other CSV editor) and do a find/replace for your source path \\server\share\

Once you have updated both of your CSV files, its time to import them.

For Drivers:

Import-Csv $home\documents\drivers.csv | %{Set-CMDriver -Id $_.CI_ID -DriverSource $_.ContentSourcePath}

For Driver Packages:

Import-Csv $home\Documents\DriverPackages.csv | %{Set-CMDriverPackage -Id $_.PackageID -DriverPackageSource $_.PkgSourcePath}

And your done!  Good Luck!

Comments (3)

  1. JStorbeck says:

    Does this script require that I be on a specific server to run? I got the export to csv fine. Changed the locations, saved the CSV file and then ran the Import-Csv on both files, the one for drivers took quite a while to return to the command prompt but the paths to the drivers when I close and open the console still show the old locations. I am running this on 1610, did that change things?

    Thank you!

  2. JStorbeck says:

    Update, after a brain cramp I figured out the issue. I had to move the CSV files through one drive to my computer and on the copy back to the server I ended up with the old files. This worked Great. Next Question, why isn't this part of the migration wizards in SCCM now?

    Thank you! Answered

    1. PFE Kevin says:

      Glad you got it worked out! I don't know for sure why it's not part of the wizard. I do know that I have used this technique several times with several different customers. It's not always during a migration. Some customer moved their source files to a new server and need to repoint them as well.

      I have also found customer that have no problems here. If your source files are stored on a different server or your using a DNS CNAME to point to a server, the path's don't need to be changed during migration.

Skip to main content