Do you still have legacy Address Lists and Email Address Policies in your Exchange Environment?

Frequently, when I review customer Exchange environments, I see Address Lists and Email Address Policies that have not been upgraded to OPATH (from LDAP) filtering.

Here are the steps:

Check to see if you still have legacy lists or policies:

Get-AddressList | FT Name,RecipientFilterType -A
Get-GlobalAddressList | FT Name,RecipientFilterType -A
Get-EmailAddressPolicy | FT Name,RecipientFilterType -A

LDAP to OPATH Conversion Script

  1. Download the script and put it in the C:\Program Files\Microsoft\Exchange Server\Scripts directory (or whichever drive you have Exchange installed on)

 https://gallery.technet.microsoft.com/scriptcenter/7c04b866-f83d-4b34-98ec-f944811dd48d

TEST THE RESULTS BEFORE YOU CONVERT!

Review the resulting text files for any errors. If there are errors, you will need to adjust the LDAP filter (in your Exchange environment) before you import/convert them to OPATH.

Email Address Policies test convert to OPATH:

Get-EmailAddressPolicy | WHERE { $_.RecipientFilterType -eq 'Legacy' } | foreach { $_.Name + [char]9 + $_.LdapRecipientFilter + [char]9 + (.\ConvertFrom-LdapFilter $_.LdapRecipientFilter) } > C:\TEMP\EmailAddressPolicyConvert.txt

 

Global Address Lists test convert to OPATH:

Get-GlobalAddressList | WHERE { $_.RecipientFilterType -eq 'Legacy' } | foreach { $_.Name + [char]9 + $_.LdapRecipientFilter + [char]9 + (.\ConvertFrom-LdapFilter $_.LdapRecipientFilter) } > C:\TEMP\GlobalAddressListConvert.txt

 Address Lists test convert to OPATH:

Get-AddressList | WHERE { $_.RecipientFilterType -eq 'Legacy' } | foreach { $_.Name + [char]9 + $_.LdapRecipientFilter + [char]9 + (.\ConvertFrom-LdapFilter $_.LdapRecipientFilter) } > C:\TEMP\AddressListConvert.txt

 

Review the resulting TXT files for errors or if just the name of the policy/list. If the TXT file is just showing the name of the policy/list that means that it was unable to convert it.

Once the above test are error free: convert all legacy address lists, GALs, and email address policies, without prompting, run three commands:

Get-EmailAddressPolicy | WHERE { $_.RecipientFilterType -eq 'Legacy' } | foreach { Set-EmailAddressPolicy $_.Name -RecipientFilter (.\ConvertFrom-LdapFilter $_.LdapRecipientFilter) -ForceUpgrade }

Get-GlobalAddressList | WHERE { $_.RecipientFilterType -eq 'Legacy' } | foreach { Set-GlobalAddressList $_.Name -RecipientFilter (.\ConvertFrom-LdapFilter $_.LdapRecipientFilter) -ForceUpgrade }

Get-AddressList | WHERE { $_.RecipientFilterType -eq 'Legacy' } | foreach { Set-AddressList $_.Name -RecipientFilter (.\ConvertFrom-LdapFilter $_.LdapRecipientFilter) -ForceUpgrade }

 

Run the command again (shown in the Exchange Management Shell diagram at top) to confirm that there are no longer any Legacy lists/policies.