Make sure a ConfigMgr task sequence has all the packages it needs

If you’ve done ConfigMgr OS deployments, you’ve probably seen an error dialog like this before:


Pretty simple, right?  Distribute this package to a local DP and then try again.  But there are often dozens (or in extreme cases, hundreds) of packages referenced by the package, so you might have to go through this cycle a few times before you get them all.  Fortunately, there are some ConfigMgr WMI classes that can help figure out which packages are missing.  With a little bit of PowerShell logic, we can automate the whole process, through these basic steps:

  1. Get a list of all the task sequences.

  2. Get a list of all the packages referenced by those task sequences.

  3. Compare the complete list of distribution points against the list for each referenced package.

  4. Add a new distribution point to each package that is missing (keeping in mind that only boot images need to be distributed to SMSPXEImages$ distribution point shares).

This process will take care of boot images, OS images, OS install packages, driver packages, software update packages, or any other type of packages that are referenced (because behind the scenes, packages are packages to ConfigMgr – only the UI differentiates).

The scripts needed to this are attached to this blog.  You’ll need to save the SCCM.psm1 file in an appropriate PowerShell module folder (see the comments in the script for more details) so that the CheckTaskSequences.ps1 script can find it (and of course you’ll have to enable PowerShell script execution using something like “Set-ExecutionPolicy RemoteSigned”).  Then, just run CheckTaskSequences.ps1 each time you create a new task sequence.  It will very quickly identify the packages that need to be distributed and take care of those for you.

Note:  Version 1.1 of the script is now attached (using version 1.5 of SCCM.psm1) to address a couple of bugs found in the current version.  See the comments in CheckTaskSequences.ps1 for more information.

Comments (18)
  1. Anonymous says:

    I am having some issues running this script? Can someone please help?
    I am getting an error: get-wmiobject : Invalid namespace “rootsms”
    Do i need to run this on the server?

  2. Anonymous says:

    omg I didn't realise this does more than report on missing packages… I have packages being copied all of the globe now >_<

  3. To filter, just change this line:

    $packageResults = Get-SCCMTaskSequencePackage | CheckPackages

    To something like this:

    $packageResults = Get-SCCMTaskSequencePackage | ? {$_.TaskSequenceID -eq ‘ABC00001’ } | CheckPackages

    In that particular example, it will only do the task sequence with ID “ABC00001”, but you could use other criteria instead.

  4. While it probably could run from Windows PE (making a WMI connection to a remote ConfigMgr server, with credentials), I don't see any real advantage to doing it that way – run it from the site server, preferably well in advance of your deployments.


  5. That's what item #4 above says it will do 🙂

  6. As written, the script does need to run on the server. But you can run it remotely if you change the “New-SCCMConnection” connection line in CheckTaskSequences.ps1 to instead be “New-SCCMConnection SERVER XXX” where “SERVER” is the server name and “XXX” is the site code.

  7. Anonymous says:

    Will this run from WinPE?

  8. Ogeccut says:

    Did anyone created a filter on the task sequence package ID???
    Thank you.

  9. It will check all packages explicitly referenced by the task sequence – those installed using the PACKAGESxxx variables aren't explicitly referenced by the task sequence, so those won't be found or distributed.


  10. Chris Jones - MSFT says:

    just wanted to say thanks a lot! this saved me a few hours worth of work!

  11. MIG says:

    Excellent post. Thank you very much!

  12. Stevep says:

    Does this also check for applications installed using the package variable in the TS? And is there a way to just list all of the packages referenced?

  13. RagTagITCo says:

    @lord_hydrax Wow, how do you just run a script without understanding what it does?

  14. RDDVLS1999 says:

    Hi Michael,

    I have used this script in the past on SCCM 2007, and it works great. Do you have any plans to create a version for SCCM 2012? I have tried the current version against our SCCM 2012 SP1 CU1 install, and while it does report on missing packages, nothing happens if the option to replicate missing packages is selected.

    Many thanks in advance,


  15. QQ says:

    SCCM 20112 R2: “No Task Sequence selected or user selected Cancel, exiting script…”

  16. Nile says:

    Thank you so much! This will save me hours!

  17. Sumit says:

    Its not checking the revision of the package. Just the pckage ID mayn’t be sufficient

  18. tarun madaan says:

    that would like you gave the light in darkness


Comments are closed.

Skip to main content