Tuesday, August 21, 2012

How to send email to a group and exclude members of some other groups

Imagine the situation - you just sent an announcement e-mail to a few departments of your organization. For simplicity, let's assume that you have used appropriate LDAP groups "A", "B" & "C". And then you realize that you have forgotten to add one more group "D" to the recipients list. And this forgotten group "D" contains some users from "A", "B" or "C" as well as some unique users.

You don't want to "spam" dozens of guys from "A", "B" & "C" again, don't you?

Unfortunately, Outlook doesn't have "Not to" field, so you have to prepare a filtered list of recipients:
"D*" = "D" - ("A" + "B" + "C")

  • Use Outlook to expand "A", "B" & "C" groups to the list of users
  • Copy ";" separated list to Word and replace all "; " by line breaks "^l"
  • Put resulting list to Excel as first column
  • Repeat the same steps for group "D" and put resulting list as second column
  • In Excel, select it all and choose "Conditional Formatting" - "Higlight Cell Rules" - "Duplicate Values"
  • Filter second column to only show "unique" or not highlighted values
  • Et viola - You have a list of people who are in "D" but not in "A", "B" or "C"!
  • Copy the list back to the Outlook message in the "To:" field and click "Check names"

No comments:

Post a Comment