Dynamic Distribution Group – Excluding Security Group

Exc_PS

It has been a while since I have posted anything on my blog, due to change of responsibilities and the new job. Now I am mainly focused on VMware and Exchange.

Most people know that Dynamic Distribution Groups are great in offering flexible and automatic management of user membership in addition to all the features offered by normal distribution groups. By the way, I won’t be detailing how to use Set-DynamicDistributionGroup cmdlet in setting a dynamic group up (please refer to powershell help by typing help Set-DynamicDistributionGroup -Examples to see some examples of how to use -RecipientFilter property).

If you image that you have all your users in one OU (which is possible) , Dynamic Distribution Group look at a specific recipient container. In some cases you want to exclude a single user from the list, now that is easy, make sure (-not(Name -like ‘name‘) is entered into your recipient filter.

Excluding one name is easy, but you don’t want to keep adding a name at a time. You could bind all of your members who you want to exclude from your dynamic group in a security group and add this line to your recipient filter (-not(MemberofGroup -eq ‘Security_Group_FQDN‘)).

Whoever is added to that Security group won’t be a member of the dynamic distribution group.

To get members of a dynamic distribution group

$group = get-DynamicDistributionGroup “Group_Name

$members = get-recipient -RecipientPreviewFilter $group.RecipientFilter

 

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: