Jump to content


lord_hydrax

SQL Query for Missing Task Sequence Packages on a Distribution Point

Recommended Posts

I've seen a lot of SQL queries over the years for finding missing Task Sequence packages on a Distribution Point, and never got one to work.

All I wanted to do was query a server name and a task sequence package ID to find out what applications or packages referenced by the TS still need to be distributed.

I finally actually got one to work (SQL isn't my strongest area :)) so I thought I'd share with everyone:

SELECT DISTINCT TSR.PackageID
,PS.PackageID
,PSD.Name
 
FROM v_TaskSequencePackageReferences AS TSR
 
JOIN v_PackageStatus AS PS ON TSR.RefPackageID = PS.PackageID
JOIN v_PackageStatusDetailSumm AS PSD ON TSR.RefPackageID = PSD.PackageID
 
WHERE TSR.PackageID = '<TSPACKAGEID>' AND PS.PackageID NOT IN (SELECT
PS.PackageID FROM v_PackageStatus AS PS 
JOIN v_TaskSequencePackageReferences AS TSR ON PS.PackageID = TSR.RefPackageID 
WHERE PS.PkgServer LIKE '%<SERVERNAME>%')

Replace <TSPACKAGEID> with the Task Sequence's unique Package ID and <SERVERNAME> with the hostname of the Distribution Point you want to query.

Also anyone who is familar with the 'Create Task Sequence Media' wizard, you can use that to check what servers are missing packages as you get a listing of servers and the number of packages from the TS that it has. Good starting point to find DPs that have missing packages.

Share this post


Link to post
Share on other sites


So I'm trying this query. It indicates all packages in the TS are distributed to the correct DP. However the TS Media wizard still insists that one package is missing. I've even selected the TS and don a 'Distribute Content' to the DP. Going to check all versions on the Applications that are referenced. Ugh.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...