runningTaskSequence variable problem

Hello,

I have a problem with runningTaskSequence variable

After an OS deployment and a reboot of the machine, runningTaskSequence variable return again true.
Can you also specify what this command is used please ?
[Runtime.Interopservices.Marshal]::ReleaseComObject($runningTaskSequence )

The only solution I found was to make a regsvr on TSCore.dll located on C:\Windows\CCM

Do you have another solution that could solve my problem ?

Thank for help

Best Regard

That function decrements reference count for the COM object. If it goes to 0, the runtime releases all its references.

In other words, it is used to release COM object’s resources. More info here: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.releasecomobject

This COM object should not be available if no task sequence is running.

Hello,

Thank for quick answer.
But with your function, I again after task sequence finished runningTaskSequence variable who returned true.
That problem is not all the time.
Have you got any idea ?

Thank you

Remember that even the reboot is the Last step in the TS, the TS will start again after the reboot to finish itself. So the TS environment is initialized for maybe 1-2 minutes. The question is, who is starting the toolkit? Is it started as an MECM application or via other process e.g. Startup script?
After an OSD all policies will be evaluated from CCM agent. So it might be that e.g. other TaskSequences (no OSD) will also be executed.
Search for a overlapping between these possible processes…