Exchange 2010 SP2 introduces “multi-value custom attributes”, 5 new custom attributes that can hold more than one value: ExtensionCustomAttribute1 to ExtensionCustomAttribute5, which can now hold up to 1,300 values each! Why do we need to store more than 1 value when we have 15 CustomAttributes?! Well, you might want to save in ExtensionCustomAttribute1 all the times you increased the user’s mailbox quota or all the databases you moved the user from/to, etc… I’m sure someone will come up with a good use for them!
These new attributes are used by the following cmdlets:
-
Set-DistributionGroup
-
Set-DynamicDistributionGroup
-
Set-Mailbox
-
Set-MailContact
-
Set-MailPublicFolder
-
Set-RemoteMailbox
There are several methods of saving data in these attributes. First, let’s look at how we can set new values (remember that these methods will overwrite any values that already existed):
Set-Mailbox Nuno –ExtensionCustomAttribute1 “DB1”
Set-Mailbox Nuno –ExtensionCustomAttribute1 “DB1”, “DB2”
$DBs = “DB8”, “DB9”, “DB10”
Set-Mailbox Nuno –ExtensionCustomAttribute1 $DBs
Now let’s add values to the existing ones. Here we have two options:
1. Using the “normal” method most administrators have been using;
2. Using the Add functionality introduced with SP1.
$mbx = Get-Mailbox Nuno
$mbx.ExtensionCustomAttribute1 += “DB2”
Set-Mailbox Nuno –ExtensionCustomAttribute1 $mbx. ExtensionCustomAttribute1
Set-Mailbox Nuno –ExtensionCustomAttribute1 @{Add = “DB3”}
Set-Mailbox Nuno –ExtensionCustomAttribute1 @{Add = “DB4”, “DB5”}
As you can see, the second method is much easier! A very welcome improvement.
To remove, we can also use both methods but, again, the easiest one is the second:
Set-Mailbox Nuno –ExtensionCustomAttribute1 @{Remove = “DB4”, “DB5”}