You also need to use "-startsWith" for "extensionAttribute05".
(user.extensionAttribute05 -startsWith "|John")
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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*')
You also need to use "-startsWith" for "extensionAttribute05".
(user.extensionAttribute05 -startsWith "|John")
"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*')"
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):
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
i can see the below but how can i set the query