Forum Discussion
Common user attributes synchronized
- Aug 22, 2025
Hi StefanoC66,
You need to use "city" not "l". The error is telling you it does not recognise "l".
When you're working with Exchange Online, you need to use the attribute names from the "property name" column of the article Vasil linked to.
If you're working with Exchange Server, you'd need to use the "LDAP display name" column.
For Exchange Online, this is what you should have tried:
New-DynamicDistributionGroup -Name "TEST" -RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (city -eq 'Text')"
Cheers,
Lain
The UI exposes only a handful of fields, there are a lot more you can leverage when creating DDG (or configuring its recipient filter) via PowerShell. Basically, any of the fields listed here should do: https://learn.microsoft.com/en-us/powershell/exchange/recipientfilter-properties?view=exchange-ps&redirectedfrom=MSDN
- StefanoC66Aug 21, 2025Iron Contributor
I was trying to do it, I found that KB as well, with this command
New-DynamicDistributionGroup -Name “TEST” -RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and ( l -eq 'Text')"
to filter by "city" which should correspond to "l"
but I got this error
Write-ErrorMessage : Cannot process argument transformation on parameter 'RecipientFilter'. Cannot convert value "(RecipientTypeDetails -eq 'UserMailbox') -and ( l -eq 'Text')" to type "System.String". Error: ""l" is not a recognized
- LainRobertsonAug 22, 2025Silver Contributor
Hi StefanoC66,
You need to use "city" not "l". The error is telling you it does not recognise "l".
When you're working with Exchange Online, you need to use the attribute names from the "property name" column of the article Vasil linked to.
If you're working with Exchange Server, you'd need to use the "LDAP display name" column.
For Exchange Online, this is what you should have tried:
New-DynamicDistributionGroup -Name "TEST" -RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (city -eq 'Text')"
Cheers,
Lain
- StefanoC66Aug 22, 2025Iron Contributor
i got it right at the end, i found my error reading better that article, but thanks again for pointing it to me