Understanding Custom Attributes
Dynamic groups
Microsoft Exchange Server 2010 and Exchange Server 2007 include 15 extension attributes. You can use these attributes to add information about a recipient, such as an employee ID, organizational unit (OU), or some other custom value for which there isn’t an existing attribute. These custom attributes are labeled in Active Directory as ms-Exch-Extension-Attribute1through ms-Exch-Extension-Attribute15. In the Exchange Management Shell, the corresponding parameters are CustomAttribute1 through CustomAttribute15. These attributes aren’t used by any Exchange components. They can be used to store Active Directory data without having to extend the Active Directory schema.
Get-Mailbox -OrganizationalUnit Sales | Set-Mailbox CustomAttribute1 “SalesOU”
Now you can create an e-mail address policy for all recipients that have the CustomAttribute1 property that equals SalesOU, as shown in this example.
New-EmailAddressPolicy -Name “Sales” -RecipientFilter { CustomAttribute1 -eq “SalesOU”} -EnabledEmailAddressTemplates “SMTP:%s%2g@sales.contoso.c
For Dynamic Groups
When creating dynamic distribution groups, e-mail address policies, or address lists, you don’t need to use the RecipeintFilter parameter to specify custom attributes. You can use theConditionalCustomAttribute1 to ConditionalCustomAttribute15 parameters instead. You can create a dynamic distribution group based on the recipients whose CustomAttribute1 is set to SalesOU, as shown in this example.
New-DynamicDistributionGroup -Name "Sales Users and Contacts" -IncludedRecipients "MailboxUsers,MailContacts" -ConditionalCustomAttribute1 "SalesOU"
Ref: https://technet.microsoft.com/en-us/library/ee423541(v=exchg.141).aspx
How to add custom attributes to rules in Dynamic Exchange Groups Exchange
Open exchange management shell run the following
Get-DynamicDistributionGroup “DynamicGroupName” | Fl
Then run the following
set-DynamicDistributionGroup “DynamicGroupName” -CustomAttribute1 DDL
Get-DynamicDistributionGroup “groupName” | FL
To make sure it worked
In this scenario only dynamic groups will be added as members of another dynamic group
To set all custom attribute of dynamic groups to same value
Get-DynamicDistributionGroup | set-DynamicDistributionGroup -CustomAttribute1 DDL
$DDG = Get-DynamicDistributionGroup “Groupname”
Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter
Leave a Reply