In control with preloading packages

There are several good blogs which describes the proces of preloading packages, explains the tool used and how to troubleshoot.

Preloading packages is proces which can be used to deploy packages to distribution points which couldn’t deployed throughout the hiearchy over slow WAN/LAN connections or to avoid overloading links. The Preload Package Tool (PreloadPkgOnSite.exe) can be used to preinstall packages on distribution points in those scenarios.

This post will explains in a few steps the proces of preloading packages works and how this progress can be monitored.

The “how” you get the files there is really not the most important thing to worry about. Once they’re there and moved to the appropriate location, preloadpkgonsite.exe is required to install the compressed source files. Once done, a status message goes back to the parent server which should stop the upstream server from copying the package source files over the wan to the child site.

Anyway, if it’s a relatively small amount of packages, you can run the execution like so:

preloadpkgonsite.exe <pkgid>

Of course, if it was a small amount of packages, we wouldn’t be having this conversation right now. so what do you do when you have an enormous directory with 75gb worth of packages? On the site server, navigate to <installdir>\bin\i386. this is where the preloadpkgonsite.exe should have been dropped. If not download the preload package tool here. Well, it would look a little something like this…

for /f “delims=.” %a in (‘dir /b \\<siteserver>\sms_<sitecode>\inboxes\\*.pkg’) do preloadpkgonsite.exe %a

That will effectively run preloadpkgonsite.exe against every known package on that child site server. Now there are caveats to making this work – one being that the .pkg has to exist on the child site server. Verify \\<siteserver>\sms_<sitecode>\inboxes\ if all package information is replicated to your distribution point.

Ensure the compressed packages are locally available at the distribution point and the read-only attribute is set (if archive attribute is set, the procedure will fail)

****** Preload Package On Site ******
Forward package status for pkg <package-id> to site <sitecode>
****** Successfully set the Compressed Package Path on this site ******
****** Successfully forwarded the information up the hierarchy ******

When all packages processed succesfully a status messages goes back to the parent server . Use the query below to determine whether the compressed packages status is ‘Received ‘.

USE <sccm database>
SELECT distinct
PS.ID as ‘PackageID’,
PS.SiteCode as ‘SiteCode’,
PCK.Name as ‘Package Name’,
‘Location’= Case PS.TYPE
when ‘1’ then ‘Compressed Package’
when ‘2’ then ‘Distribution Point’ End,

‘Status’= Case PS.Status
when 0 then ‘NONE’
when 1 then ‘SENT’
when 2 then ‘RECEIVED’
when 3 then ‘INSTALLED’
when 4 then ‘RETRY’
when 5 then ‘FAILED’
when 6 then ‘REMOVED’
when 7 then ‘PENDING_REMOVE’ END

FROM dbo.PkgStatus PS
WHERE PS.SiteCode = ‘<sitecode>’

Run above query to determine if all status messages succesfully forwarded. If all compressed packages indicates status ‘Received’ the status messages sent succesfully to the database. The siteserver is aware of the packages are locally available at the distribution point(s). If not registered packages nevertheless still be copied though the WAN/LAN connection. Continue with the next step adding package(s) to the distribution point(s). Do this using the Copy Package Wizard.

Status messages of preloaded packages received.

When finished adding package(s) to the distribution point(s) packages open the distribution manager log (distmgr.log) @ the distribution point site. Packages are extracted from SMSPKG folder instead of rather copied over WAN/LAN connection. Bear in mind the proces of extracting packages can take a while depending the number and size of packages. The default value for the simultaneous extraction of packages is 3. You can temporarily increase up to 7 simultaneous operation to speed up the proces.

Increase the number of maximum operations.

Run again the above SQL query when all packages extracted and updated to the distribution point(s).  Each package has a status message ‘Received’ and ‘Installed’.

Packages are succesfully extracted.

This, the packages successfully registered on the distribution point(s) without copying them over the WAN/LAN

Have fun!


2 thoughts on “In control with preloading packages

  1. Pingback: Need help preloading packages onto distribution points « MS Tech BLOG

  2. Muhammad Jamshaid

    Good article

    if you get error indicating

    Failed to get the specified package in the database. Please check if you have instance rights to that package.

    Run (preinst.exe /syncchild SiteCode ) an primary site.

    preinst.exe /syncchild ABC

    after some time run following on secondary site

    for /f “delims=.” %a in (‘dir /b \\\sms_\inboxes\\*.pkg’) do preloadpkgonsite.exe %a

    100% success

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s