Saturday, July 21, 2018

Exchange Export/Import EUM Addresses Cross Forest

In a previous post I showed you how to set up Exchange UM, Cross Forest with a Selective Trust in place.

Under the "Enable Users for Unified Messaging > Sync the EUM Proxy Addresses" section of that article, I outlined that in order for UM to function Cross Forest or when you have Exchange in a Resource Forest and your Skype For Business environment is in the Accounts Forest, you need to sync over the "EUM" proxy addresses, backwards to the Accounts Forest.

In my environment, we run MIM (Microsoft Identity Management) to sync our users from the Accounts to the Resource Forest. Unfortunately, I don't have direct control over what attributes get sync'd and the infrastructure "trolls" who do administer MIM have zero interest in adding the backwards sync of those EUM addresses...yeah don't listen to the Messaging Admin that this is something needed for actual functionality <rolleyes>

Since we can't (they won't) sync those EUM addresses, I came up with a way to export the EUM addresses that are assigned to mailboxes in the Resource Forest and output into a CSV. Then, we can take that CSV and use it to import them on the AD Users in the Accounts Forest.
This will at least save you time from manually copying/pasting them, especially if you have to do a bunch at one time (I just had to do 20 of them; no way was I gonna copy those by hand).

Export EUM Proxy Addresses to CSV

First, we'll need to export a list of all UM Enabled Mailboxes, and their corresponding EUM proxy addresses.

**Note** Using Exchange UM results in two EUM addresses per user - a 3rd party UM solution like Cisco Call Manager only uses one EUM address. (We run both types in my environment, until we cutover to purely Exchange UM)

Here's an example:

Exchange UM:


Cisco UM:

EUM:292;phone-context=Cisco CallManager Headquarters.exchangeitup.com

The following cmdlet will grab both types of EUM addresses and export them to a CSV separating them with a comma.
We're using a comma because the actual EUM address already contain semicolons as seen above, and that will come into play later when we import them.

Fire up the Exchange Management Shell (EMS) in your Resource Forest and run:

Get-Mailbox -Filter '((EmailAddresses -like "*EUM*"))' | select DisplayName, @{n="EUMAddress";e={($_.EmailAddresses | ? {$_ -like "EUM*"}) -join ","}} | Export-CSV "C:\Temp\EUM_Addresses.csv" -notypeinformation

This cmdlet will filter for only EUM addresses, leaving out any other type of proxy addresses, because we don't need them.

Import CSV And Add EUM Addresses

Once you have your CSV, copy it over a server in your Accounts Forest and open up the Active Directory PowerShell.

Run the following cmdlet, and it will import all EUM address according to DisplayName:

Import-Csv "C:\Temp\EUM_Addresses.csv" | foreach {Set-ADUser -Identity $_.DisplayName -Add @{Proxyaddresses=($_.EUMaddress -split ",")}}

**Note** There's no need to add any silently continue if the user already has the EUM in place, it won't throw any errors that it exists, and the cmdlet will run until it's finished.

**Note** See that comma that splits the EUM addresses in the last part of the cmdlet? If we had used a semicolon in the export, it would have imported the EUMs on several different lines, and that wouldn't be correct.

Depending on how many you had to import, give it a bit for the cmdlet to complete.

Once it's finished, go check a couple AD accounts from your list in your Accounts Forest, and you will see those EUM addresses populated in the proxyaddresses attribute!

Next, go tell the Infrastructure/AD guys that you don't need their help, you can do everything on your own ;)

No comments:

Post a Comment