question

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 asked ·

Dynamic Unifed group

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


office-exchange-server-administrationoffice-exchange-online-itprooffice-exchange-server-itpro
tes.jpg (22.9 KiB)
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@GlennMaxwell-2309
Did the above answers help? Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.

0 Votes 0 · ·
KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered ·

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

 (user.extensionAttribute05 -startsWith "|John")

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



· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KyleXu-MSFT avatar image
1 Vote"
KyleXu-MSFT answered ·

"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*')"
· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 answered ·

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



tes.jpg (22.9 KiB)
· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Where do you create this kind group and how command do you used to create it? I don't see such kind of group in Office 365.

Do you mean Office 365 group? If so, it is a static group rather than dynamic group.

0 Votes 0 · ·
GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 answered ·

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



ext.jpg (50.0 KiB)
· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 answered ·

i have the below dynamic membership rule but i am not getting any users populated
(user.extensionAttribute10 -eq "'john'") and (user.employeeId -ne "'T*'")

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KyleXu-MSFT avatar image
1 Vote"
KyleXu-MSFT answered ·

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



· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 answered ·

will the below query work, becoz no members have been found
14145-test2.jpg



test2.jpg (12.8 KiB)
· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.