unsupported query

Roger Roger 6,741 Reputation points
2021-03-31T19:36:12.577+00:00

Hi all

I am creating dynamic Unified group i am using the below query and i am getting unsupported format. please guide me.

(user.accountEnabled -eq true) -and ((user.department -startsWith "1000") or (user.department -startsWith "1001")) -and ((user.country -eq "A") or (user.country -eq "B") or (user.samaccountname -eq "Test.User1") or (user.samaccountname -eq "Test.User2"))

i want to pull all users from departments of 1000 and 1001 from countries A and B along with two static users.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,145 questions
{count} votes

Accepted answer
  1. Roger Roger 6,741 Reputation points
    2021-04-01T13:20:31.707+00:00

    The below query worked for me,

        (user.accountEnabled -eq true) -and ((user.department -startsWith "1000") or (user.department -startsWith "1001")) -and ((user.country -eq "A") or (user.country -eq "B") or (user.userPrincipalName -eq "******@contoso.com") or (user.userPrincipalName -eq "******@contoso.com"))  
    

    i have used ((user.country -eq "A") or (user.country -eq "B") or (user.userPrincipalName -eq "Test.User1@Company portal .com") or (user.userPrincipalName -eq "Test.User2@Company portal .com")) suspecting if user1 or user2 leave the company still this query will work.

    in the below i suspect if user1 or user2 leaves the company the query will not work.

    ((user.country -eq "A") or (user.country -eq "B")) -and ((user.userPrincipalName -eq "Test.User1@Company portal .com") or (user.userPrincipalName -eq "Test.User2@Company portal .com"))


0 additional answers

Sort by: Most helpful

Your answer

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