Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Overview of this book

Table of Contents (21 chapters)
Microsoft Exchange Server PowerShell Cookbook Third Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Excluding hidden recipients from a dynamic distribution group


When creating dynamic distribution groups through the Exchange Management Console, you can specify which recipients should be included in the group using a basic set of conditions. If you want to do more advanced filtering, such as excluding hidden recipients, you will need to configure the OPATH filters for your dynamic distribution groups through the Exchange Management Shell. In this recipe, you'll learn how to use the shell to create a recipient filter that excludes hidden recipients from dynamic distribution groups.

How to do it...

Let's say that we need to set up a distribution group for our TechSupport department. The following commands can be used to create a dynamic distribution group that includes all the mailboxes for the users in the TechSupport OU that are not hidden from address lists:

New-DynamicDistributionGroup -Name TechSupport `
-RecipientContainer contoso.com/TechSupport `
-RecipientFilter {
  HiddenFromAddressListsEnabled...