Close Menu
    Facebook X (Twitter) Instagram
    Saturday, October 11
    X (Twitter) LinkedIn Reddit RSS
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»ConfigMgr (SCCM)»SCCM Configmgr 2007 Replace Source Package path from Local Drive to UNC path for list of packages

    SCCM Configmgr 2007 Replace Source Package path from Local Drive to UNC path for list of packages

    Eswar KonetiBy Eswar KonetiAugust 12, 12:21 pm2 Mins Read ConfigMgr (SCCM) 1,439 Views
    Share
    Facebook Twitter LinkedIn Reddit

    In My Previous post,I blogged about SCCM Report list packages that do not use UNC path (i.e package Uses local Drive) and this is not good if you are migrating the packages from SCCM 2007 to Configuration Manager 2012.

    After you get list of packages that use local drive,you will have to change them to UNC .

    Note: This script will change the source path from Local drive(D:) to UNC path(\\servername\) for all the list of given packages at one Go.

    For ex: Current pkg source path: D:\applications\adobe 9.2 Eng ,change to UNC: \\servername\applications\Adobe 9.2 Eng

    If you have different UNC path for each package and not same what i have, modify the script.

    You can either use custom Tools like package source changer from coretech OR Powershell or other scripts.

    I wrote Simple Script that works only for Standard Software Distribution Packages but not for Software Update /OSD/ Driver packages.

    Pipe the list of packages from the report to pkgs.txt.

    strComputer = "SCCM Server name"

    Set objfso = CreateObject ("Scripting.filesystemObject")
    Set pkgs = objfso.OpenTextFile ("C:\pkgs.txt", 1)
    Set outputList = objfso.OpenTextFile ("C:\outputList.txt", 2, True)

    Do While Not pkgs.AtEndOfStream
    pkgName = pkgs.ReadLine

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\SMS\site_CEN")

    Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM SMS_Package WHERE PackageID = '" & pkgName & "'")

    For Each objItem in colItems
    '        Wscript.Echo "PkgSourcePath: " & objItem.PkgSourcePath
    outputList.WriteLine pkgName & vbTab & "Old Path"& vbTab & objItem.PkgSourcePath

    tmp = replace((objItem.PkgSourcePath),"D:", "\\servername")
    objItem.PkgSourcePath = tmp
    objItem.put_

    outputList.WriteLine pkgName & vbTab & "New Path" & vbTab & objItem.PkgSourcePath

    Next

    loop

    After you change the package source path,packages will start updating on all the Sites where ever it was targeted previously.So please be careful while doing this task because of network traffic.

    Hope it helps!

    change Change Package Source Path configmgr Local Drive Migration Path PkgSourcePath SCCM 2007 sccm report source Source path UNC Path VB Script
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    SCCM SQL Report – Compare Installed Apps on TWO Different Computers

    July 13, 10:35 am

    Migrate Microsoft 365 Updates from SCCM/MECM to Intune for Co-Managed Devices

    February 11, 9:50 pm

    How to detect the source of registry key modifications on windows devices – Intune

    November 21, 8:49 pm

    Leave a ReplyCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2025 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.