Dynamic Unifed group

Glenn Maxwell 11,496 Reputation points
2020-07-27T18:02:48.387+00:00

Hi Experts

I am using exchange hybrid environment, i have custom attributes in AD for all users which are synced to Azure AD. For example
I have manager Tim, Time reports to Roger and Roger Reports to John, i want to create dynamic unified group for Johns Organization,please help me with the syntax. i have permanent employees who employee ids stats with 5000, for example 5000,5001 and temporary employee whose employee ids starts with T1000, T1001

for example user todd has this AD attribute in extensionAttribute05---|John|Roger|<Tim>|

How do i use the below information and create a query to build unified group.

John Temporary-----(user.extensionAttribute05 -like 'John') and (user.employeeId -like 'T*')
John Permanent-----(user.extensionAttribute05 -like 'John') and (user.employeeId -notlike 'T*')

13962-tes.jpg

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,576 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,667 questions
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,266 Reputation points
    2020-07-29T05:38:07.103+00:00

    You also need to use "-startsWith" for "extensionAttribute05".

    (user.extensionAttribute05 -startsWith "|John")  
    

    14156-snipaste-2020-07-29-13-37-03.png

    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. KyleXu-MSFT 26,266 Reputation points
    2020-07-28T02:30:50.65+00:00

    "employeeId" isn't a valid attributes for Exchange server. You need to use another attribute such as "extensionAttribute01" to replace it.

    Then you will could create need dynamic distribution group with commands below(You cannot use wildcards as the first character, so you need to use "|John*" for the customAttribute5):

    New-DynamicDistributionGroup -Name "John Permanent" -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (CustomAttribute1 -like '5*') -and (CustomAttribute5 -like '|John*')"
    New-DynamicDistributionGroup -Name "John Temporary" -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (CustomAttribute1 -like 'T1*') -and (CustomAttribute5 -like '|John*')"
    
    1 person found this answer helpful.
    0 comments No comments

  2. KyleXu-MSFT 26,266 Reputation points
    2020-07-29T02:10:04.857+00:00

    You need to use " -startsWith", here is a test for you(User a.a employeeId is 5000, so it is a valid member. User b.b isn't start with 5, so it isn't a valid member):
    14154-snipaste-2020-07-29-10-04-40.png

    1 person found this answer helpful.
    0 comments No comments

  3. Glenn Maxwell 11,496 Reputation points
    2020-07-28T05:37:07.837+00:00

    i am looking for dynamic unified group and not Dynamic distribution group, i want to try the below query to build unified group but not sure
    13870-tes.jpg


  4. Glenn Maxwell 11,496 Reputation points
    2020-07-28T09:10:31.727+00:00

    i can see the below but how can i set the query
    13970-ext.jpg

    0 comments No comments

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.