Hi All,
I am using EWS with Powershell for the first time, and although my code works, I have run across an issue I am not able to fix. I am trying to fix users' contacts that have been imported incorrectly from another mail system, which is working fine for most entries. However, when an email address field includes a colon (:) when I call the address using the following:
($contact.EmailAddresses[[Microsoft.Exchange.WebServices.Data.EmailAddressKey]::EmailAddress1].Address)
it does not read the address. I have identified this doesn't appear to be a code issue, as when I replace the address with another, still with invalid characters, such as < and spaces, this works fine. I presume this would be a conflict with the EWS syntax and use of : within the syntax itself.
I have tried finding a way to separate the "EmailAddress1" part so that the colon included within the address field doesn't affect the script but haven't found a successful way of doing this. I hope all the above makes sense. Is there anyone who is able to direct me to a solution so we can call the email addresses that contain the invalid colons?
Many thanks,
Mike Parker