unified groups

Glenn Maxwell 10,046 Reputation points
2023-03-02T05:49:57.2333333+00:00

Hi All

i want to create a dynamic unified group in office365. i am using exchange 2016 hybrid environment. below attributes are synced to Azure AD(employee id, country)

we have Full time employees their employee ids starts with F for example F1,F2,F3 and we have temp employees whose employee ids starts with T1,T2,T3. i want to pull all these users from the country USA

In Azure AD, under groups, i have changed the group type to dynamic,  which of the below query will pull me the information. please correct me with the syntax.

(user.accountEnabled -eq true) -and (user.employeeId -notStartsWith "T") -and (user.country -eq "USA")

or

(user.accountEnabled -eq true) -and (user.employeeId -notStartsWith "T*") -and (user.country -eq "USA")

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,160 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,330 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,869 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,359 questions
{count} votes

Accepted answer
  1. Jame Xu-MSFT 4,166 Reputation points
    2023-03-03T06:04:05.28+00:00

    Hi @Glenn Maxwell ,

    To create a dynamic unified group in Office 365 based on the criteria you described, you can use the query below.

    This query will pull all users who are enabled, have an employee ID starting with "F" or "T", and are located in the USA.

    The notStartsWith operator is not supported in the query syntax for dynamic groups in Azure AD. Instead, you can use the like operator with a wildcard (*) to match users with an employee ID starting with either "F" or "T".

    (user.accountEnabled -eq true) -and ((user.employeeId -like "F*") -or (user.employeeId -like "T*")) -and (user.country -eq "USA")
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful