Exam SC-300 All QuestionsBrowse all questions from this exam
Question 38

You have an Azure Active Directory (Azure AD) tenant that contains the users shown in the following table.

You create a dynamic user group and configure the following rule syntax.

user.usageLocation -in ["US","AU"] -and (user.department -eq "Sales") -and -not (user.jobTitle -eq "Manager") –or (user. jobTitle -eq "SalesRep")

Which users will be added to the group?

    Correct Answer: A

    The dynamic group rule needs to be evaluated according to its logical operators considering precedence, which follows this pattern: first 'AND' operations, and then 'OR' operations. The rule can be divided into two parts: the 'AND' block (user.usageLocation -in ["US","AU"] -and (user.department -eq "Sales") -and -not (user.jobTitle -eq "Manager")), and the 'OR' block ((user.jobTitle -eq "SalesRep")). With this in mind, we determine the results accordingly. Given the table information: User1 is located in the US, is from the Sales department, and is not a Manager, so they satisfy the entire 'AND' condition. User2 located in Finland with SalesRep as job title only satisfies the 'OR' condition, but fails to meet the 'AND' condition entirely. User3 in Australia from the Sales department, but as a Manager, fails the 'AND' condition due to the job title. Thus, applying the concatenated logical constraints, only User1 matches the rule properly, making them the only user added into the dynamic group.

Discussion
ydecacOption: E

user.usageLocation -in ["US","AU"] == User 1 & User 3 -and (user.department -eq "Sales") == User 1 & User 3 -and -not (user.jobTitle -eq "Manager") == User 1 –or (user. jobTitle -eq "SalesRep")

keanwvegas

Just to further explain this... 1. Think of everything up to the OR as 1 big 'if, and if, and if' statement (statement 1). In this case, that'd leave only User 1 to be selected. 2. Think of everything after the OR as a separate statement (statement 2), meaning 'statement 1 OR statement 2', now including user2 who is a salesrep.

Nyamnyam

well, that's basically what happens when admins or devs don't use parentheses. OR is outside of the AND statement, so User 1 and User 2 are the correct answer.

Er_01

Based on my current repro of it, user 1 and 2 are correct. Hinges on the separation of the and not not and or operators. However, you have to manually edit the expression to even come up with this gotcha question. Using the UI it fails. You have to add the brackets in part 1 and the not operator, which is bad syntax. In short it was a badly designed question using double negative in part 3. Should have used -ne. Typical MS worthless gotcha question.

Justin0020

You have to think about it to realise that the OR statement adds User2 as well. User 1 and 2, option D is right.

meself7Option: D

D is correct always resolve acording to precedence, first all the -and operators, only after that the -or operators. https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/groups-dynamic-membership#operator-precedence

BRoald

D is wrong because User 2 is located in Finland and cannot be added to the dynamic group. I tested this and im 100% sure ONLY user 1 gets added. I tested this dynamic rule and got the result by validating an user that has an usage location set on Finland: RED CROSS: user.usagelocation -in ["US","AU"] [UsageLocation = "FI"] So again, only User 1 gets added to this group 100%

Holii

Wrong. test again. You completely ditched the -or flag by testing only user.usagelocation...obviously you're going to get different results. Proper order of precedence is as follows: -or -and -and user.usageLocation -in ["US", "AU"] user.department -eq "Sales" -not user.jobTitle -eq "Manager" user.jobTitle -eq "SalesRep" the -or flag trumps all other conditionals.

stev_auOption: D

Answer D (User 1 and User 2) is 100% correct. Tested in lab.

ServerBrain

I dispute that test. user.usageLocation -in ["US","AU"] excludes User2

amurp35Option: D

this is a question to test your knowledge of the order of operations or precedence. There are two main statements, a string of ands and then an or. User 2 does not get included in the first statement but does in the last. Therefore User 2 does get included. ANDs are like multiplication for math. They get done first, and grouped into one arithmetical operation, the result of which is then compared to the next group or singular statement, which is the OR.

TeresaCNOption: A

user.usageLocation -in ["US","AU"] == User 1 & User 3 -and (user.department -eq "Sales") == User 1 & User 3 -and -not (user.jobTitle -eq "Manager") == User 1 –or (user. jobTitle -eq "SalesRep") (no) Answer is : A. User 1

mkendellOption: D

user.usageLocation -in ["US","AU"]: This part checks if the usage location of the user is either in the United States ("US") or Australia ("AU"). -and (user.department -eq "Sales"): It checks if the user's department is "Sales". -and -not (user.jobTitle -eq "Manager"): This part ensures that the user's job title is not "Manager". -or (user.jobTitle -eq "SalesRep"): This part checks if the user's job title is "SalesRep". Putting it all together: The command checks if the user's usage location is either in the US or Australia, their department is "Sales", and they are not a "Manager". If all these conditions are met, the user is included. Additionally, if the user's job title is "SalesRep", regardless of the previous conditions, they are also included.

curtmcgirtOption: D

((user's location is US or AU) AND (their department is SALES) AND (their job title is NOT Manager)) (OR their job title is SalesRep.)

haazybanjOption: D

D is right

SumitSahooOption: D

{ user.usageLocation -in ["US","AU"] -and (user.department -eq "Sales") -and -not (user.jobTitle -eq "Manager") } –or { (user. jobTitle -eq "SalesRep") } {user 1 } -or {User 2} So and is both u1 and u2.

ChiragtrapasiyaOption: D

User1 from user.usageLocation -in ["US","AU"] -and (user.department -eq "Sales") -and -not (user.jobTitle -eq "Manager") User2 from or (user. jobTitle -eq "SalesRep")

jscaOption: D

Tested this day : Answer D

vladi72Option: D

What confusing here is OR statement. To make it simple: OR is not part of NOT it's separate statement. If you read this way answer D is correct.

cac91e6Option: D

when you put the command as is in to azure you will get an error ,The actual syntax should be "user.usageLocation -in ["US","AU"] -and (user.department -eq "Sales") -and -not (user.jobTitle -eq "Manager") or (user.jobTitle -eq "SalesRep")" and this gives us a user1 and user2 i tried it out myself , Poorly designed question

SirafOption: D

Correct Answer is D.

AlscoranOption: D

Because of the Or statement

BenLam

If people read it out loud it makes sense. Filter the user's location by US or AU AND their department is SALES AND their job title is NOT Manager or SalesRep.

curtmcgirt

nah. (Filter the user's location by US or AU AND their department is SALES AND their job title is NOT Manager) (OR their job title is SalesRep.)

JimboJones99Option: A

It's an OR at the end

JimboJones99

My bad, it's D because of the OR. Not A