ConfigMgr migration script – Driver source path conversion
Use the following PowerShell script to convert driver files’ source path from an old server location to the new location.
Updated 5/5/14: fixed creation of $ChangePath variable to account for mixed-case of the $OldPath and $NewPath.
# By https://t3chn1ck.wordpress.com # Version 1.1 # Site Code + : Set-Location "GAL:" # Note: max query limit is 1000 items, need to increase value as appropriate Set-CMQueryResultMaximum 2000 $DriverArray = Get-CMDriver $OldPath = "\\2007SERVER\source$" $NewPath = "\\2012SERVER\cmsource$" ForEach ($Driver in $DriverArray){ $OldPkgPath = $Driver.ContentSourcePath.ToLower() If ($OldPkgPath.StartsWith($OldPath)){ $ChangePath = $OldPkgPath.Replace($OldPath.ToLower(), $NewPath.ToUpper()) Set-CMDriver -Id $Driver.CI_ID -DriverSource $ChangePath Write-Host "Changed: " $Driver.CI_ID " to " $ChangePath -f Green } Else { Write-Host "Not changed: " $Driver.CI_ID " of " $OldPkgPath -f DarkYellow } }
June 11, 2018 at 12:17 pm
[…] Matt Shadbolt http://blogs.technet.com/b/configmgrdogs/archive/2013/05/09/package-amp-application-source-modification-scripts.aspx with some updates by Nick Moseley https://t3chn1ck.wordpress.com/2014/04/18/fixes-to-microsoft-package-source-conversion-scripts and additions https://t3chn1ck.wordpress.com/2014/05/05/configmgr-migration-script-driver-source-path-conversion/ […]
March 12, 2020 at 10:25 am
[…] Matt Shadbolt http://blogs.technet.com/b/configmgrdogs/archive/2013/05/09/package-amp-application-source-modification-scripts.aspx with some updates by Nick Moseley https://t3chn1ck.wordpress.com/2014/04/18/fixes-to-microsoft-package-source-conversion-scripts and additions https://t3chn1ck.wordpress.com/2014/05/05/configmgr-migration-script-driver-source-path-conversion/ […]
March 23, 2020 at 3:55 pm
[…] Matt Shadbolt http://blogs.technet.com/b/configmgrdogs/archive/2013/05/09/package-amp-application-source-modification-scripts.aspx with some updates by Nick Moseley https://t3chn1ck.wordpress.com/2014/04/18/fixes-to-microsoft-package-source-conversion-scripts and additions https://t3chn1ck.wordpress.com/2014/05/05/configmgr-migration-script-driver-source-path-conversion/ […]
August 11, 2021 at 3:20 am
Hi Nick,
thanks a lot for your script.
I’ve been looking for days now how to change the SourcePath of my Drivers at my SCCM.
I thought that your script will do my task but unfortunatly I only get the “Not changed” case. The script can access the drivers but it don’t change the SourcePath.
Do you have an idea what I made wrong or what I can do to make it working?
I would be really happy if you could help me or give me an direction.
Best regards
Michael
August 14, 2021 at 6:54 am
I’m glad that this content is still useful 7 years later!! I’m uncertain if there were some underlying PowerShell code changes from SCCM 2012 R2 to the newer ConfigMgr current branch which might impact this. If you find the answer, I’m sure that others would like to know the solution for future use!