Skip to content

Wildcard or Logic in Task Sequence Variable Condition

Featured Replies

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.

 

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

  • Author

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.

  • 5 years later...

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.

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.