Test Task Sequence Variables in Windows

There is a very easy way to test task sequence variables without doing a full OS deployment. You can use “ServiceUI.exe” witch is located in the MDT toolkit package under “Tools\x64\” and then run it on a Windows machine.

1. Create a Custom task sequence and add a “Run Command Line” step with the following command: “tools\x64\ServiceUI.exe” -process:TSProgressUI.exe C:\Windows\System32\cmd.exe

2. Deploy it to a collection that contains you Windows Test PC and run it from “Software Center”.

3. When the cmd appear, then type “PowerShell” to start PowerShell

4. In this example I will get the value of a computer variable called OSDtest.

4a. Type “$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment”

4b. Type: “$OSDtestvar =  $tsenv.Value(“OSDtest”)”

4c. Type “Write-Host $OSDtestvar”

4d. The output is “Test Variable”image