All Users exclusion

I am trying to setup a "exclusion" to remove people from email that is sent to the "All Users Group"  At my last job, someone had setup a exclusion and we would actually put "notallusers" in the Attribute 15 of their Exchange account and then that would exclude them from getting emails sent out to the All Users Group.   I am trying to enable something like that at my present position.  If anyone can shed some light on what I need to do, it would be greatly appreciated. (We are using Exchange 2013)

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will SzymkowskiSenior Solution ArchitectCommented:
Yes using the CustomAttribute (1-15) using a value of your choice and then referencing this in your Filter on the Address List would accomplish that.

Do you have a list of users that you want "excluded" from this AllUsers Address List?

If you do I can create a powershell script that will add the properties to their CustomAttribute and then you just need to update the conditions on the AllUsers AddressList.

MistrPC1Author Commented:
I appreciate the help, but if I am going down the same path you are talking about ....I need to:

1. Open Exchange ECP
2. Select Groups
3. Select the All Users Distribution Group
3. Click on Membership
4. Under the heading  "Membership in this group will be determined by the rules you setup below.   Click the "Add Rule" button.
5. Select the Attribute I want  (in this case I will select "Custom Attribute 15"
6. Specify words or phrases and input "notallusers"
7. Save

Then go to the Individual email box I want to be excluded and Under the General tab, go down to Custom Attributes and add "notallusers" in the 15 spot

And this will prevent users from getting any emails that is is sent to the All Users Distribution List?

**note**   I do not have a list as of yet, but I do not think its going to be an extensive list of email addresses

Will SzymkowskiSenior Solution ArchitectCommented:
You have the correct idea however, are you talking about Dynamic Distribution Groups or Address Lists? When you create these Conditions it is the reverse of what you siad. They are conditions based on WHAT you are trying to find.

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

MistrPC1Author Commented:
I am talking about Dynamic Distribution List.  One of the extra "rules" is for  everyone within the OU that houses all of our user.  I need to be able to add the attribute in field 15 for "notallusers" and then go to each email address and put that same attribute in and that user gets exempt from any email sent to the all users distribution list
Will SzymkowskiSenior Solution ArchitectCommented:
You can add this using a script if you have a list of users you want to target, powershell specifcially.

I can assist with that if needed.

MistrPC1Author Commented:
Yes sir, your help would be appreciated.

Thank you
Will SzymkowskiSenior Solution ArchitectCommented:
Add your users to a text file, one users per line. Save the text file as c:\users.txt and run the script below...
$Users = Get-content "c:\users.txt"
ForEach ($User in $Users) 
        Set-Mailbox -Identity $User -CustomAttribute15 "notallusers"


Open in new window

MistrPC1Author Commented:
Wait.....I don't think we are on the same page.  By Adding the "notallusers" to Custom Attribute 15 of a particular email account. That script will prevent them from getting the all users email?   Seems like there needs to be more to this on the actual dynamic distro list???
Will SzymkowskiSenior Solution ArchitectCommented:
You also need to update the conditions as well. I am assiting in the automation of updating the fields required rather than doing them one by one.

MistrPC1Author Commented:
So I just add the condition  of notallusers to custom attribute15 on the distro?
Will SzymkowskiSenior Solution ArchitectCommented:
As i stated before when you modify conditions on Distribution Groups you are putting conditions in based on what "you want to FIND" not "what you want to EXCLUDE".

MistrPC1Author Commented: where I really need the assistance is the exclusion portion.  With the few amount of email addresses I can add the custom attribute  to them with no issues, but I need the exclusion portion and where to set it
HariomExchange ExpertsCommented:
Ok , Here you go.

1) Create Security Group called "AllStaff_Exclusion_Group" (You need to add members to this group who need to exclude from "all staff" group

2) Open Power Shell and run following command

Set-DynamicDistributionGroup "ALLStaff" -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (MemberOfGroup -ne 'CN=AllStaff_Exclusion_Group,OU=Test,DC=Testing,DC=Com')"

This command will set filter to "ALLSTAFF" Dynamic DistributionGroup to Exclude the AllStaff_Exclusion_Group members

Note : OU=Test,DC=Testing,DC=Com')" (OU=WhereAllStaff_Exclusion_Group is stored and DC=YouDomain,DC=Com"

Note : Replace "ALLSTAFF" with your Dynamic Distribution group

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MistrPC1Author Commented:
Thanks for everyones help.   Sorry about the long reply...I went on vacation.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Protocols

From novice to tech pro — start learning today.