How to get the step of a Task Sequence with a SQL query
Hi everyone,

I tried to create a report based on a Task Sequence to retrieve all packages that a TS contains. The only thing I'm able to have is the package name, version, etc. Is there a table or a view that contains the value : Type, Name, Package, Program and the order (all the fields that are in the task sequence editor panel) ?

Thanks

Here my current query :

select v_TaskSequencePackage.Name 'TaskSequenceName',
v_TaskSequenceReferencesInfo.PackageID 'TaskSequenceID',
 v_TaskSequenceReferencesInfo.ReferenceName 'PackageName',
 v_TaskSequenceReferencesInfo.ReferenceVersion 'Version'
 from v_TaskSequencePackage
inner join v_TaskSequenceReferencesInfo on v_TaskSequenceReferencesInfo.PackageID = v_TaskSequencePackage.PackageID
where v_TaskSequencePackage.Name like 'Insert your Task Sequence Name Here'
  • Edited by EricPare Tuesday, November 29, 2011 2:15 PM
August 29th, 2011 1:25pm

When I list the ProgramName of a task sequence, the return value is * because there is no program with a task sequence. Program are for Package.

With v_TaskSequenceReferencesInfo, I'm able to see all packages from a Task Sequence but I still don't know the execution order or which program is running for a package.

  • Edited by EricPare Wednesday, September 07, 2011 7:24 PM
Free Windows Admin Tool Kit Click here and download it now
September 7th, 2011 7:21pm

Hmm... we are getting somewhere !!! With your request, I have the program Name, which is good!

But the TS_ReferenceID is not the order of my task. PkgID MTL000E9 (Ref_ID : 461) is OSISoft PI Datalink 3.1.6.1 which is the third in my task.

No, i'm from Montreal but we have a site in Kamloops :)


  • Edited by EricPare Thursday, September 08, 2011 3:04 PM
September 8th, 2011 3:02pm

My colleague found it!

Select Distinct Max(v_TaskExecutionStatus.Step)'Step',
v_TaskExecutionStatus.ActionName
from v_TaskExecutionStatus, v_Advertisement
where v_TaskExecutionStatus.AdvertisementID=v_Advertisement.AdvertisementID
AND v_Advertisement.PackageID='MTL0015A'
AND LastStatusMessageID=11134
Group By v_TaskExecutionStatus.ActionName
Order By Step

The task sequence must be runned at least once to make sure that the table as data in it.

  • Marked as answer by EricPare Tuesday, November 29, 2011 2:14 PM
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2011 2:14pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics