Share via

MDT - Filter conditions

C.Huss 25 Reputation points
2024-10-06T14:40:29.94+00:00

Hey, I am deploying Windows 11 via MDT.

I am using my own variable for installing stuff, called dcApplicationID.

Works fine so far. Now I want to filter a task sequence. Only if dcApplicationID does or does not match execute the powershell script behind.

But it is not working. Are my conditions wrong ? Please have a look at my screenshots.

2 TaskSequences:

TaskSequence 1 - Execute if dcApplicationID is App1 or App2

TaskSequence 2 - Execute if dcApplicationID is NOT App1 or App2IsNotApp

IsApp

Thx Chris

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
0 comments No comments

2 answers

Sort by: Most helpful
  1. AllenLiu-MSFT 49,436 Reputation points Microsoft External Staff
    2024-10-07T02:38:36.6133333+00:00

    Hi, @C.Huss

    Thank you for posting in Microsoft Q&A forum.

    Agree with Marek, the logic for TaskSequence 1 is not correct, the conditions will always be true. We should use "AND" instead of "OR".


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".


  2. Marek Duda 0 Reputation points
    2024-10-06T15:30:11.98+00:00

    It looks like you’re on the right track with the conditions, but the issue might be in how the conditions are set. Make sure you’re using the proper syntax for filtering based on your custom variable (dcApplicationID).

    For TaskSequence 1:

    • Condition: dcApplicationID = "App1" OR dcApplicationID = "App2"

    For TaskSequence 2:

    • Condition: dcApplicationID != "App1" AND dcApplicationID != "App2"

    Double-check the logic and ensure that quotes are used correctly, as MDT is case-sensitive with variable names. Also, test the variable value during deployment to confirm it’s being set properly.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.