0 votes


some of our users have multiple email addresses and also have different variations of their name and perhaps their assistants name within the SMTP addresses.
for instance bob cook has the following emails: bcook@abc.com, cookb@abc.com, bcook@domain.com, bobcook@abc.com, tmarie@abc.com.

I've created a task that says "if the 'email proxy addresses' property contains '@abc.com', then
modify mailbox setting for the user: modify email addresses (remove 'smtp:%mailnickname%@abc.com')

which obviously works great if the mailnickname matches...but not certain how to remove the others.

Please let me know how I can remove all instances of email addresses that contain @abc.com from their SMTP.

Thanks in advance!

by (1.7k points)

can someone pls reply?

I hope my subject isn't confusing

1 Answer

0 votes
by (215k points)
selected by
Best answer


To do this, you will need to use a PowerShell script. Have a look at the following script from our Script Repository that will do the job: Remove values of a multivalued property using regular expressions.

Parameters that you need to specify in the script:

  1. $property: "proxyAddresses";
  2. $regex: "smtp:\w+@abc\.com"

To add the script to your Scheduled Task, use the Run a program or PowerShell script action.



just sent you something else.
it seems to remove all smtp addresses even ones that do not mention abc.com.
we only want to get rid of abc.com and nothing else.


any luck?


hi-- just checking in to see if theres a reason the script removes all addresses and not the one specified.




We've forwarded all the available information to our script guys. They are checking the script, but no luck so far. We'll update you as soon as they come up with something.


ok, thanks

Related questions

0 votes
1 answer

Hallo @All, I'm working in an cloud environment with many tenants and every tenat has the same organizational unit structure. Now I want to add a security rule that deny access to ... *,DC=contoso,dc=msft,dc=com I hope someone has a hint for me. Thanks Arne

asked Oct 26, 2015 by ATiedemann (360 points)
0 votes
1 answer

As part of business rules etc we are able to add\remove accounts to groups. It would be nice if this feature could be extended to allow for wildcard ... multiple groups that meet the matching condition (without resorting to PowerShell script actions). Thanks

asked Aug 5, 2014 by firegoblin (1.6k points)
0 votes
1 answer

Hello! Is there a way to clear the AD attribute "thumbnailPhoto" with a checkbox property? I wanted to implement a checkbox in the mask "Modify user" and if the box is checked, clear the attribute. How do I implement this? Much appreciated, Marco

asked Apr 21 by marco_jandl (60 points)
0 votes
0 answers

Good morning, I need to export in excel custom attribute from user in one row. Like this: columns: DisplayName,Email,%adm-CustomAttributeDate10%(Friendyname),%adm- ... create the report correctly with the columns and rows formatted. Any suggest? Thanks

asked Apr 8 by Simone.Vailati (270 points)
0 votes
1 answer

Hello, I am able to pull photo's of our employees from our HR solution into our active directory. However the HR api only provides a base64 encoded string. This string then ... work, if you have any better solutions or see any problems. Please let me know.

asked Feb 23 by vlg (40 points)
2,779 questions
2,512 answers
26,871 users