How to use Task Sequence Variables in a running Task Sequence by script in ConfigMgr 2007

Using Task Sequence variables in a running Task Sequence by script is actually really straight forward. Also for most of you this might be common knowledge, but I noticed this week that it doesn’t count for everyone, yet. So in this post I will show the two (only two!) steps it takes to get or set variables with your script. The first step is to create an instance of Microsoft.SMS.TSEnvironment. As this is a COM automation object, you could use every language that can use those. I will use VBScript in this example. Creating the object can be done by the following line of code: set env = CreateObject(“Microsoft.SMS.TSEnvironment”) Now that we’ve got our object the second step is to get, or set Task Sequence …

Read more