Created
April 17, 2018 06:12
-
-
Save dstreefkerk/c2bca3f4c9c0a3d4b7c1769ed4e3fd15 to your computer and use it in GitHub Desktop.
PowerShell function to create an X500 proxy address from a IMCEAEX NDR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Create-X500ProxyAddressFromLegacyExchangeDN($Address) { | |
# As per https://support.microsoft.com/en-au/help/2807779/imceaex-non-delivery-report-when-you-send-email-messages-to-an-interna | |
$Address = $Address.Replace('_','/') # Replace any underscore character (_) with a slash character (/) | |
$Address = $Address.Replace('+20',' ') # Replace "+20" with a blank space | |
$Address = $Address.Replace('+28','(') # Replace "+28" with an opening parenthesis character | |
$Address = $Address.Replace('+29',')') # Replace "+29" with a closing parenthesis character. | |
$Address = $Address.Replace('IMCEAEX-','') # Delete the "IMCEAEX-" string | |
$Address = $Address.Split('@')[0] # Delete the "@mgd.domain.com" string | |
$Address = "X500:$Address" # Add "X500:" at the beginning | |
$Address | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And yes, I've seen this one: http://www.o-xchange.com/2014/07/script-for-converting-bounce-back.html
I prefer this more verbose method, as it's clearer for someone to pick up on what the script's doing.