Link to home
Start Free TrialLog in
Avatar of wyhelpofficer
wyhelpofficer

asked on

SCCM 2007 Variable from VBS Script

Hi

I am using the following vbs script in an attempt to pass the variable "migrate" into a Task Sequence in SCCM 2007.

Basically, the script asks the user if they wish to run the USMT section of the Task Sequence, with a "yes" or "no" button.

The idea is that when the Task Sequence gets to the USMT group, it will look at the value of the "migrate" variable, and will only run on condition that it equals 1 (i.e. user clicked yes).

Here is the script I have made:

Dim migrate
Set migrate = CreateObject("Microsoft.SMS.TSEnvironment")
If MsgBox ("Is User State Migration Required?", vbYesNo, "USMT Request") = vbYes Then
migrate = 1
Else
migrate = 2
End If

So, the script runs fine and prompts the user correctly, but the Task Sequence does not run the USMT group, even if the user chooses "yes" at the prompt.

I know the USMT group works fine, because it runs if I remove the prompt and condition. So I can only assume that the "migrate" variable is not being passed through to the Task Sequence. (Therefore "migrate" does not equal 1, so the group does not run.)

Could anyone tell me if I have set up the script to pass the variable to the Task Sequence properly, or do I need to somehow create the variable in the TS before defining it in the script?

Hopefully I explained all that well enough!

Also, just one quick secondary question about posting on this site - where is the best place to post SCCM questions, I can't find anything specific in the zones?

Many thanks
Phil
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wyhelpofficer
wyhelpofficer

ASKER

Thanks Rob, I was just specifying the value incorrectly - your modifications worked a treat :)
Great!  Kind of a lucky guess.....glad it worked out!

Rob.