How to use Multi-Valued Custom Attributes in Exchange 2010 SP2
One of the new features in Exchange Server 2010, SP2, is the new ability to use Multi-Valued Custom attributes:
Exchange 2010 SP2 introduces five new multi-value custom attributes that you can use to store additional information for mail recipient objects. The ExtensionCustomAttribute1 to ExtensionCustomAttribute5 parameters can each hold up to 1,300 values. You can specify multiple values as a comma-delimited list.
These attributes (accessible only via the Exchange Management Shell) can be used with most types of recipients, including Mailboxes, Mail Contacts, Remote Mailboxes and Distribution Groups, and you could use them to store all kinds of extra text-based information against accounts.
So, how do you use the new features? Well, if you are using Powershell, you can use them by assigning an array to the new Extension Custom Attribute1 - 5 properties. As an example, I'll create a simple array, assign it to ExtensionCustomAttribute1 property and then retrieve it:

As it's stored as an array, we can then use PowerShell to add extra attributes to it on demand:

In my example, I am using it to record changes. Although it's got limits, it still could be ideal to store a change log of certain actions to an account, such as the date a quota change was applied for example.
By the way, you'll notice the @{Add="Value"} syntax in the example above; if you aren't familiar with the syntax, you can read more here about Using Multivalued Properties in Exchange 2010.
Steve
Updated – Disabling Auto-mailbox mapping in Exchange 2010
In February this year I wrote about how to disable the automatic mapping of shared mailboxes in Exchange 2010 SP1, using a custom PowerShell script that "wraps" the Add-MailboxPermission command and after execution, removes the attribute in Active Directory that is used to automatically mount the mailbox in Outlook.
With Exchange 2010 SP2, there's great news - this workaround is no longer required, as in SP2 a new parameter has been added to the native cmdlet.
Check out the updated article here, and stay tuned for a future article explaining how to extend this functionality to the Exchange Management Console
Exporting Exchange 2010 ActiveSync statistics for iOS Devices
When exporting ActiveSync statistics from your Exchange Server 2010 environment, you've got a number of options, including using the Export-ActiveSyncLogs cmdlet to parse IIS log files and produce a number of CSV reports to help understand the way your ActiveSync devices are being used, the use of Device troubleshooting logs to retrieve client-side logs on a user-by-user basis to help diagnose issues, and use of the Get-ActiveSyncDeviceStatistics cmdlet to interrogate the information stored by Exchange and Active Directory about each ActiveSync device partnership.
The final option is what provides the foundation for this script, however when just exporting information on it's own the built in cmdlet doesn't interpret the information encoded in the User Agent string that helps understand what versions of iOS are in use across your business. Therefore as well as exporting the data from Exchange, this script maps the information stored in Exchange to iOS versions.
Usage:
Example Output:
Script (downloadable below)
# Generates a CSV file containing ActiveSync Device Statistics with iOS Specific Information.
#
# .PARAMETER OutputCSVFile
# Filename to save the output CSV file as
#
# .EXAMPLE
# .\Export-MessageTrackingLogsForRecipient.ps1 -OutputCSVFile C:\output.csv
param(
[parameter(Position=1,Mandatory=$true,ValueFromPipeline=$false,HelpMessage="Output CSV File Name")][string]$OutputCSVFile
)
# The following is a Hash Table containing information used to
# map the Apple Device User Agent to it's corresponding iOS version
$iOSVersions=@{"508.11"="2.2.1";
"701.341"="3.0.0";
"701.400"="3.0.1";
"702.367"="3.2";
"702.405"="3.21";
"702.5"="3.3";
"703.144"="3.1";
"704.11"="3.1.2";
"705.18"="3.1.3";
"801.293"="4.0.0";
"801.306"="4.0.1";
"801.400"="4.0.2";
"802.117"="4.1";
"803.148"="4.2.1";
"806.190"="4.3";
"806.191"="4.3";
"807.4"="4.3.1";
"808.7"="4.3.2";
"810.2"="4.3.3";
"811.2"="4.3.4";
"812.1"="4.3.5";
"901.334"="5";
"901.403"="5.0.1";
"901.405"="5.0.1"}
# Retrieve mailboxes of users who have a connected ActiveSync Device
$CASMailboxes = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true -and -not displayname -like "CAS_{*"} -ResultSize Unlimited;
[array]$Mailboxes = $CASMailboxes | Get-Mailbox;
# Create an array to store the output
$Output=@();
# Perform a set of actions against each mailbox retrieved
foreach ($Mailbox in $Mailboxes)
{
# Retrieve the ActiveSync Device Statistics for the associated user mailbox
[array]$ActiveSyncDeviceStatistics = Get-ActiveSyncDeviceStatistics -Mailbox $Mailbox;
# Use the information retrieved above to store information one by one about each ActiveSync Device
foreach ($Device in $ActiveSyncDeviceStatistics)
{
# Where possible use the information stored in the Device User Agent to understand the iOS device version in use
$iOSVersion = "N/A";
if ($Device.DeviceUserAgent -like "*/*") {
$rawiOSVersion = ($Device.DeviceUserAgent).Substring(($Device.DeviceUserAgent).IndexOf("/")+1);
if ($iOSVersions[$rawiOSVersion])
{
$iOSVersion = $iOSVersions[$rawiOSVersion];
}
}
# Create a new object to store this ActiveSync device information in our CSV file
$OutputItem = New-Object Object;
# Add information to the object
$OutputItem | Add-Member NoteProperty Username $Mailbox.SamAccountName;
$OutputItem | Add-Member NoteProperty "Display Name" $Mailbox.DisplayName;
$OutputItem | Add-Member NoteProperty "Device Type" $Device.DeviceType;
$OutputItem | Add-Member NoteProperty "Device Model" $Device.DeviceModel;
$OutputItem | Add-Member NoteProperty "iOS Version" $iOSVersion;
$OutputItem | Add-Member NoteProperty "Device ID" $Device.DeviceID
$OutputItem | Add-Member NoteProperty "Status" $Device.Status
$OutputItem | Add-Member NoteProperty "ActiveSync Policy" $Device.DevicePolicyApplied
$OutputItem | Add-Member NoteProperty "ActiveSync Policy Status" $Device.DevicePolicyApplicationStatus
$OutputItem | Add-Member NoteProperty "Last Sync" $Device.LastSuccessSync
$OutputItem | Add-Member NoteProperty "Last Sync Attempt" $Device.LastSyncAttemptTime
$OutputItem | Add-Member NoteProperty "Last Policy Update" $Device.LastPolicyUpdateTime
$OutputItem | Add-Member NoteProperty "First Sync" $Device.FirstSyncTime
# Add the object to our array of output objects
$Output += $OutputItem;
}
}
# Print the output object to the screen in a table format with a subset of details for ease of reading
$Output | Format-Table Username,"Device Type","Device ID","Last Sync"
# Export the full set of data to the specified CSV file
$Output | Export-CSV -Path $OutputCSVFile -NoTypeInformation
Version 1.0, 5th December 2011
Download ExportActiveSyncDeviceStatistics.zip
New Section – Recommended Exchange Reference Material
We all have books, whitepapers and documentation that we often end up referring to from time to time, whether it’s a refresher on a topic you’re a little rusty on or just to double check a few facts. For my benefit, and hopefully yours, here’s my handy list of Exchange reference material…
Recommended Exchange Reference Material


