?
Solved

Assistance Required with Powershell command to modify Dynamic Distribution Group - Exchange 2010

Posted on 2016-10-19
3
Medium Priority
?
114 Views
Last Modified: 2016-10-20
Hi There,

I am needing to add to this existing dynamic distribution group an additional filter. The filter is to exclude from this group exchange mailboxes that have been selected to be hidden from address lists. I believe filter to add is this: -and -not(HiddenfromAddresslistsEnabled -eq $true)

However I am running into an issue when adding in this filter as nothing is being accepted in powershell when trying to modify the filter. Can someone please assist with letting me know the required command to update the filter to include the new filter "-and -not(HiddenfromAddresslistsEnabled -eq $true)" ?

The current filter is shown below and I have also attached a screen capture.

((((((RecipientType -eq 'UserMailbox') -and (-not(Name -like 'Belton IT')))) -and (-not(Name -like 'support')))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))
done.PNG
0
Comment
Question by:Benlton IT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Expert Comment

by:Peter Hutchison
ID: 41852093
Try this to get the old filter and append the new filter text and set the group with the new filter.

$grp = Get-DynamicDistributionGroup "group name"
$filter = $grp.RecipientFilter
$newfilter = " -and -not(HiddenfromAddresslistsEnabled -eq $true)"
$newstr = "$filter $newfilter"
Set-DynamicDistributionGroup "group name" -RecipientFilter $newstr
0
 
LVL 16

Accepted Solution

by:
Todd Nelson earned 2000 total points
ID: 41852095
Run this command first to get the recipient filter value for your dynamic distribution group (DDG)...

Get-DynamicDistributionGroup -Identity "DDG_NAME" | fl Name,RecipientFilter

Open in new window


The result should return something similar to this currently set for the filter...

((((CustomAttribute1 -eq 'TestDDG') -and (Alias -ne $null))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))

Open in new window


Before the last parentheses, I added " -and (-not(HiddenFromAddressListsEnabled -eq 'True'))" to format the value that will make up the updated filter...

{((((CustomAttribute1 -eq 'TestDDG') -and (Alias -ne $null))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')) -and (-not(HiddenFromAddressListsEnabled -eq 'True')))}

Open in new window


NOTE: The filter must be encapsulated with the squiggly brackets or an error will occur.  An error will occur even when quotes are used too.

Finally, to update the filter, I ran the command like this.

Set-DynamicDistributionGroup -Identity "DDG_NAME" -RecipientFilter {((((CustomAttribute1 -eq 'TestDDG') -and (Alias -ne $null))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')) -and (-not(HiddenFromAddressListsEnabled -eq 'True')))}

Open in new window


Upon completion, verification of the DDG resulted in mailboxes explicitly hidden from the GAL that do not show when previewing from the DDG Filter tab.

P.S. What you are requesting to do only satisfies the admin's preview from the DDG in the Exchange mgmt. console, as the mailboxes that are hidden from the GAL are not visible for users using Outlook or OWA.
2
 
LVL 1

Author Closing Comment

by:Benlton IT
ID: 41853031
Thanks so much for your help.
0

Featured Post

Bringing Advanced Authentication to the SMB Market

WatchGuard announces the acquisition of advanced authentication provider, Datablink, with one mission – to bring secure authentication to SMB, mid-market, and distributed enterprises with a cloud-based solution, ideal for resale via their established channel & MSSP community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question