Exchange Server - Internal DDG Filter Including Mailboxes from Other Company Division

alee-work 21 Reputation points

Below is an example of the DDG recipient filter that is only supposed to include mailboxes from CompanyA:
((((MemberOfGroup -eq 'CN=#CompanyA - Rigs Universal,OU=CompanyADistributionGroups,OU=CompanyAUsers,DC=CompanyA,DC=internal') -or (((((((((((RecipientType -eq 'UserMailbox') -and (Company -eq 'CompanyA'))) -and (Title -eq 'CompanyA Relief Push'))) -or (Title -like 'Rig Manager'))) -or (((((((RemoteRecipientType -eq 'Migrated') -and (Company -eq 'CompanyA'))) -and (Title -eq 'CompanyA Relief Push'))) -or (Title -like 'Rig Manager'))))) -or (((((((RecipientType -eq 'MailContact') -and (Company -eq 'CompanyA'))) -and (Title -eq 'CompanyA Relief Push'))) -or (Title -like 'Rig Manager'))))))) -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')))

For some reason, internal mailboxes from CompanyB are also included in the DDG. The only similarity I found was that the "Rig Manager" title field was the same.

Any ideas as to why the CompanyB would be included? Based on the criteria combined, the mailboxes included in the DDG should only be CompanyA company and Rig Manager title. Please advise if you have any thoughts on this. Thanks.

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,380 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,397 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao-MSFT 37,571 Reputation points Microsoft Vendor

    Hi @alee-work

    According to your post, I suppose the problem may be the following syntax:

    -and (Company -eq 'CompanyA') -and (Title -eq 'CompanyA Relief Push') -or (Title -like 'Rig Manager')  

    This syntax would add mailboxes whose Company is CompanyA and Title equals CompanyA Relief Push, or mailboxes whose Title contains Rig Manager (this would add CompanyB's Rig Manager to this DDG)

    To be simple, it is supposed to be A and (B or C), but currently it is (A and B) or C.

    I suppose the right syntax here should be:

    -and (Company -eq 'CompanyA') -and (Title -eq 'CompanyA Relief Push' -or Title -like 'Rig Manager')  

    The whole filter should be like:

    (MemberOfGroup -eq 'CN=#CompanyA - Rigs Universal,OU=CompanyADistributionGroups,OU=CompanyAUsers,DC=CompanyA,DC=internal') -or ((RecipientType -eq 'UserMailbox') -and (Company -eq 'CompanyA') -and (Title -eq 'CompanyA Relief Push' -or Title -like 'Rig Manager')) -or ((RemoteRecipientType -eq 'Migrated') -and (Company -eq 'CompanyA') -and (Title -eq 'CompanyA Relief Push' -or Title -like 'Rig Manager')) -or ((RecipientType -eq 'MailContact') -and (Company -eq 'CompanyA') -and (Title -eq 'CompanyA Relief Push' -or Title -like 'Rig Manager')) -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'))  

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful