I’ve come across and issue where an email advisory addin to outlook is picking up on old smpt proxy addresses that are left over from our migration to exchange online. The app is supposed to warn users when they are emailing an external contact. We’ve discovered that this Addin is not longer recognising exchange contacts that still have an automatically created company smtp address.
I’ve kludged together a script that I’m having some difficulty with and any help would be appreciated:
The Search part works fine but I can’t get the removal part to work. I think the problem lies with needing to use the Get-ADObject instead of the Get-ADUser the script was made for.
Before we proceed … when you post code or sample data or console output please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Without that the forum software tries to interpret your code and may remove some characters like dollar signs.
Thanks in advance
That’s unfortunately not that helpful. What does that mean? Do you get error messages?
Why do you think that? And why don’t you use Get-ADUser and Set-ADUser?
There were multiple proxyaddresses that matched that search outcome.
When I Specified the search parameters so that it would only do each one it worked!
Hmmm … very strange … it seems not to work at all when you provide more than one smtp address at a time. So you may remove them one by one. It’ll increase the runtime. But at least it does the job.
Though it still balks at any name with a “-” in it.
It left maybe 50 out of 2500 contacts. so that many I can edit manually.
I really appreciate your help Olaf!
Have a great Xmas!!!