Finding whether a task sequence can be run from a server

-- Using "ReferencePackageType = 257" to filter to OSD task sequences
select
 dp.ServerName
, tsp.packageid
, tsp.Name
, tsp.Description
, case when a.packageid is not null then 'Missing Package(s)' else '' end as [Status]
from v_DistributionPoints dp
cross join v_tasksequencepackage tsp
inner join v_TaskSequenceReferencesInfo tsri on tsp.packageid = tsri.packageid and tsri.ReferencePackageType = 257
left join
(
select distinct
 ps.ServerNALPath
, tsp.packageid
from v_tasksequencepackage tsp
inner join v_TaskSequencePackageReferences tspr on tspr.packageid = tsp.packageid
inner join v_package p on p.packageid = tspr.RefPackageID
left join v_PackageStatusDistPointsSumm ps on ps.PackageID = tspr.RefPackageID
where InstallStatus <> 'Package Installation complete'
) a
on a.ServerNALPath = dp.NALPath and a.packageid = tsp.packageid
order by 1, 2
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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