Share via

DDL with title is empty

Austin Sundar 436 Reputation points
2022-07-08T10:39:24.453+00:00

Hi All,

I am trying to create a DDL for a specific location and exclude accounts with TITLE is empty/null.
I use the filter below but i still gets the accounts with the header is empty. could anyone help?

-RecipientFilter {(Office -like "location") -and ((-not(RecipientTypeDetailsvalue -eq 'RoomMailbox')) -and (-not(RecipientTypeDetailsvalue -eq 'SharedMailbox')) -and (-not(RecipientType -eq 'MailContact')) -and (-not(Title -eq '$null')))}

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.


1 answer

Sort by: Most helpful
  1. Vasil Michev 127K Reputation points MVP Volunteer Moderator
    2022-07-08T17:13:45.933+00:00

    You need to remove the quotes around $null, otherwise it will take it as a string value (i.e. it will only match users for which Title is set to the "$null" string value). Here's a working example:

    Set-DynamicDistributionGroup test -RecipientFilter {(Office -like "Home") -and ((-not(RecipientTypeDetailsvalue -eq 'RoomMailbox')) -and (-not(RecipientTypeDetailsvalue -eq 'SharedMailbox')) -and (-not(RecipientType -eq 'MailContact')) -and (Title -ne $null))}  
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.