Jump to content


red9r

Wildcard or Logic in Task Sequence Variable Condition

Recommended Posts

I am trying to create a task sequence step that only runs when the first 6 characters of the computer name equal a certain string.

 

From what I can tell, I can't use a wildcard or logic in the Task Sequence Variable Condition under the Options tab.

 

Example:

 

Given the following computer names, ABCDEF001, ABCDEF002, and BCDEFG001, the task sequence step should only run on ABCDEF001, and ABCDEF001. It should not run on BCDEFG001.

 

I have tried:

Task sequence variable OSDComputerName equals ABCDEF%

Task sequence variable OSDComputerName equals ABCDEF*

Task sequence variable OSDComputerName equals ABCDEF$

Task sequence variable #Left("%OSDComputerName%",6)# equals ABCDEF

 

Any suggestions on how I might go about accomplishing this?

 

I have also tried creating another variable in customsettings.ini that takes the first six characters of the computer name but it does not work because customsettings.ini is processed before the computer name is submitted.

 

Share this post


Link to post
Share on other sites


Hi,

That is correct you cannot use wildcards for tasksequence variables, I would suggest that you put it in a script instead and do you logic there and return a task sequence variable based on the result.

Regards,
Jörgen

Share this post


Link to post
Share on other sites

Hi,

That is correct you cannot use wildcards for tasksequence variables, I would suggest that you put it in a script instead and do you logic there and return a task sequence variable based on the result.

Regards,

Jörgen

I thought about that but here is the problem I run in to with that.

 

OSDComputerName is originally set with the userexit script. During the LTI deployment, the user has the option to change the computer name. If the name is changed, the new variable (also created in the userexit script) does not reflect the change because the script has already ran.

 

I'm guessing my only other option is to create a separate script to set the variable and new task sequence step to run the script.

Share this post


Link to post
Share on other sites

Sorry to necro this, but is it still the case that you cannot use wildcards of any type inside a task sequence variable, dynamic or regular?

edit: It appears ? and * can be used.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...