SCCM - Change Source Software File Locations with PowerShell

Ever want to change all the source directories of your Packages, Drivers, Driver Pckages, and Update Packages all at once? Ever want to migrate all your source software to a new server in a few hours? You can do it with Powershell!
 
Connect to SCCM using Powershell

 Run these commands
  • Export the list to a .csv using the PowerShell command below
  • Edit the .csv with the new file location
  • Import the .csv using the PowerShell command below
Export Package List
Get-CMPackage | select Name, PackageID, PkgSourcePath | export-csv $home\documents\packages.csv
Import Package List
Import-CSV $home\documents\packages.csv | %{Set-CMPackage -id $_.PackageID -Path $_.PkgSourcePath}
Export Driver List
Get-CMDriver | select LocalizedDisplayName, ContentSourcePath, CI_ID | Export-Csv $home\documents\Drivers.csv
Import Driver List
Import-Csv $home\documents\Drivers.csv | %{Set-CMDriver -Id $_.CI_ID -DriverSource $_.ContentSourcePath}
Export Driver Package List
Get-CMDriverPackage | select Name, PkgSourcePath, PackageID | Export-Csv $home\documents\DriverPackages.csv
Import Driver Package List
Import-Csv $home\documents\DriverPackages.csv | %{Set-CMDriverPackage -Id $_.PackageID -DriverPackageSource $_.PkgSourcePath}
Export Update Package List
Get-CMSoftwareUpdateDeploymentPackage | select Name, PkgSourcePath, PackageID | Export-Csv $home\documents\UpdatePackages.csv
Import Update Package List
Import-Csv $home\documents\UpdatePackages.csv | %{Set-CMSoftwareUpdateDeploymentPackage -Id $_.PackageID -Path $_.PkgSourcePath}

 
Source:






Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.