I have this customer who had to move all driver packages from from one server a another. This of cause meant all the Data Source references had to be change as well.

Once al the packages were moved to the new server I ran the following  two scripts to change the source. All you need to change is the $Site to your site code, or add it is a parameter when you run the script. You will obviously also have to type in the old and new path.

Syntax: Script.ps1 –Site XXX

If you want to only run against one driver/package for testing you can also add the ID as a parameter

Syntax: Script.ps1 –ID XXXXXXXX –Site XXX

Drivers

1 param($ID = "*",$Site = "CEN") 2 3 $drivers = Get-WmiObject SMS_Driver -Namespace root\SMS\site_$Site 4 5 $drivers | here-object{$_.ContentSourcePath -like "OldServer\OldShare\*" -and $_.PackageID -like $ID} | 6 ForEach-Object{$_.ContentSourcePath = $_.ContentSourcePath -replace "OldServer\\OldShare", "NewServer\\NEWShare"; $_.Put()}

Driver packages

1 param($ID = "*",$Site = "CEN") 2 3 $packages = Get-WmiObject SMS_DriverPackage -Namespace root\SMS\site_$Site 4 5 $packages | Where-object{$_.PkgSourcePath -like "*OldServer\OldShare*" -and $_.PackageID -like $ID} | 6 ForEach-Object{$_.PkgSourcePath = $_.PkgSourcePath -replace "OldServer\\OldShare","NewServer\NewShare"; $_.Put()}