Dynamic Device Group Rule for Marketing Name

MD-102 By islever Editorial Last updated

Short answer

C Use the -contains operator to match devices with 'Marketing' in their display name.

Question

You have a Microsoft 365 E5 subscription. You need to create a dynamic device group that will contain any device that has the word Marketing in its name. Which device membership rule should you use?
  1. (device.displayName -in "Marketing")
  2. (device.displayName -in "Marketing")
  3. (device.displayName -contains "Marketing") Correct Answer
  4. (device.displayName -contains "Marketing")

Key Takeaways

This question tests knowledge of Azure AD dynamic group membership rule operators, specifically distinguishing between substring matching (-contains) and exact/in-list matching (-in).

Learn how to create a dynamic device group in Microsoft Intune that matches devices containing 'Marketing' in their name. This page establishes the correct syntax using the -contains operator without wildcards.

Common mistake: Users often incorrectly use the -in operator with wildcards or add asterisks to the -contains operator, which is not valid syntax for this context.

Expert Analysis

Why the Answer Is Correct

The correct syntax for filtering by a substring in a dynamic group is using the -contains operator directly on the property value. The expression (device.displayName -contains "Marketing") correctly identifies any device where the display name includes the word "Marketing" anywhere within the string.

Why the Other Options Are Wrong

Option A uses -in, which expects a list of exact values, not a substring search. Option B incorrectly combines -in with wildcard characters, which are not supported in this manner. Option D adds unnecessary wildcards to the -contains operator; the operator inherently checks for inclusion, so adding * makes it invalid syntax.

Community Comment Notes

Community members confirm that -contains is the standard approach for substring matching. As one user noted, "C is correct" referencing official documentation, while others emphasized that wildcards are not needed with -contains.

Official Reference

https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership

This link opens the official vendor documentation in a new tab.

Exam Strategy

Memorize the specific operators used in Azure AD dynamic groups: -eq for equality, -ne for not equal, -contains for substrings, and -in for lists of exact values. Do not mix them with SQL-style wildcards.

Frequently Asked Questions

Why can't I use wildcards like *Marketing*?

The -contains operator natively supports substring matching, so wildcards are redundant and cause syntax errors.

What is the difference between -contains and -in?

-contains checks if a value is a substring of another, while -in checks if the value exists in a predefined list of exact strings.

More MD-102 FAQ →

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 3 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 3

  1. Moot2 👍 2 Answered C
    C is correct https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership
  2. Meek_Learner 👍 1 Answered C
    • The -contains operator checks if a string includes a specific substring, regardless of whether the letters are uppercase or lowercase. For example, it would find "Marketing" in "Marketing Department", "marketing_team", and "Sales & Marketing". • You’re looking for the substring "Marketing" (no wildcards needed). The -contains operator automatically checks if this string is part of the device name.
  3. HvD 👍 2 Answered C
    Agreed

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All MD-102 Questions

Access 92 questions with complete answers and detailed explanations.

View Full MD-102 Practice Test →

← Back to MD-102 Study Guide