exam questions

Exam SC-300 All Questions

View all questions & answers for the SC-300 exam

Exam SC-300 topic 1 question 38 discussion

Actual exam question from Microsoft's SC-300
Question #: 38
Topic #: 1
[All SC-300 Questions]

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?

  • A. User1 only
  • B. User2 only
  • C. User3 only
  • D. User1 and User2 only
  • E. User1 and User3 only
  • F. User1, User2, and User3
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ydecac
Highly Voted 2 years, 4 months ago
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")
upvoted 36 times
[Removed]
2 years, 1 month ago
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.
upvoted 19 times
Nyamnyam
1 year, 6 months ago
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.
upvoted 3 times
Er_01
1 year, 3 months ago
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.
upvoted 3 times
...
...
...
Justin0020
1 year, 1 month ago
You have to think about it to realise that the OR statement adds User2 as well. User 1 and 2, option D is right.
upvoted 4 times
...
...
meself7
Highly Voted 2 years, 4 months ago
Selected Answer: 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
upvoted 22 times
BRoald
2 years, 2 months ago
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%
upvoted 16 times
Holii
1 year, 11 months ago
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.
upvoted 4 times
Labelfree
6 months, 3 weeks ago
This is what Copilot says | The OR flag, basically negates the need to be included under the usage location. if there was no OR flag, they would need to be in US or Australia, but since there's a condition "OR Job Title: SalesRep" that's all that is needed to include them.
upvoted 1 times
...
...
...
...
Frank9020
Most Recent 4 months, 1 week ago
Selected Answer: D
User1 & User2
upvoted 1 times
...
Frank9020
5 months, 1 week ago
Selected Answer: A
A. User1 only: user.usageLocation -in ["US","AU"] -and (user.department -eq "Sales") -and -not (user.jobTitle -eq "Manager") –or (user.jobTitle -eq "SalesRep") This rule includes users who: Have a usage location in “US” or “AU”. Are in the Sales department. Are not Managers. Or have the job title “SalesRep”: User1: Located in the United States, department is Sales, job title is Associate. Meets the location (US) and department (Sales) criteria, and is not a Manager. User2: Located in Finland, department is Sales, job title is SalesRep. Does not meet the location criteria (Finland), but meets the job title “SalesRep”. User3: Located in Australia, department is Sales, job title is Manager. Meets the location (AU) and department (Sales) criteria, but is excluded because HE is a Manager..
upvoted 5 times
...
Labelfree
5 months, 3 weeks ago
Selected Answer: D
Tested D is correct. Have to replace dashes with hyphen's for code to work properly. (user.usageLocation -in ["US", "AU"]) -and (user.department -eq "Sales") -and -not (user.jobTitle -eq "Manager") -or (user.jobTitle -eq "SalesRep")
upvoted 1 times
...
Labelfree
5 months, 3 weeks ago
Selected Answer: A
None of them are right, but if you enter the Dyn group code in proper format it only pulls User1. Tested, I get an error invalid character using code the provided. After reformatting to "(user.usageLocation -in ["US","AU"]) -and (user.department -eq "Sales") -and ((user.jobTitle -ne "Manager") -or (user.jobTitle -eq "SalesRep"))" it only pulls User1
upvoted 2 times
...
TweedleMB
5 months, 3 weeks ago
Selected Answer: D
-and without brackets men's that only one condition is taken to -and
upvoted 1 times
...
PrismaConsultores
6 months, 4 weeks ago
Selected Answer: D
Desglosemos la regla: user.usageLocation -in [“US”, “AU”]: El usuario debe estar en Estados Unidos (US) o Australia (AU). -and (user.department -eq “Sales”): El usuario debe pertenecer al departamento de ventas (Sales). -and -not (user.jobTitle -eq “Manager”): El usuario no debe tener el título de trabajo “Manager”. –or (user.jobTitle -eq “SalesRep”): O el usuario debe tener el título de trabajo “SalesRep”.
upvoted 1 times
...
fortunaXI
7 months, 2 weeks ago
D (User1 and user2) is the correct answer. Confirmed in a Test Lab.
upvoted 1 times
...
Chiragtrapasiya
10 months, 3 weeks ago
Selected Answer: 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")
upvoted 2 times
...
jsca
1 year ago
Tested this day : Answer D
upvoted 1 times
...
vladi72
1 year, 1 month ago
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.
upvoted 1 times
...
mkendell
1 year, 1 month ago
Selected Answer: 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.
upvoted 2 times
...
cac91e6
1 year, 3 months ago
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
upvoted 2 times
...
curtmcgirt
1 year, 5 months ago
Selected Answer: 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.)
upvoted 2 times
...
Siraf
1 year, 5 months ago
Correct Answer is D.
upvoted 1 times
...
Alscoran
1 year, 6 months ago
Selected Answer: D
Because of the Or statement
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...