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!