Home

Dynamic DL Filter on Address List Membership

%3CLINGO-SUB%20id%3D%22lingo-sub-286582%22%20slang%3D%22en-US%22%3EDynamic%20DL%20Filter%20on%20Address%20List%20Membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-286582%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20create%20a%20new%20dynamic%20DL%20in%20exchange%20online%20that%20will%20include%20on-prem%20and%20online%20users.%26nbsp%3B%20I%20know%20to%20do%20that%20the%20recipienttype%20%22mailuser%22%20has%20to%20be%20included.%26nbsp%3B%20The%20issue%20with%20that%20is%20all%20mailboxes%20on-prem%20are%20mail%20users%20in%20O365%20including%20rooms%20and%20shared%20mailboxes.%26nbsp%3B%20I'd%20like%20to%20exclude%20these%20as%20much%20as%20possible.%26nbsp%3B%20I%20know%20that%20I%20can%20include%20%22AddressListMembership%22%20in%20the%20recipient%20filter%2C%20but%20I%20am%20struggling%20with%20that.%26nbsp%3B%20I'd%20like%20to%20exclude%20any%20user%20that%20is%20included%20in%20the%20address%20list%20%22%5CAll%20Rooms%22.%26nbsp%3B%20If%20I%20run%20the%20command%20%22Get-MailUser%20-ResultSize%20Unlimited%20%7C%20%3F%20%7B%24_.AddressListMembership%20-match%20%22All%20Rooms%22%7D%22%2C%20I%20only%20get%20rooms%20back%20that%20are%20on-prem.%26nbsp%3B%20Handy%20-%20that's%20what%20I%20was%20going%20for.%26nbsp%3B%20But%20if%20I%20try%20to%20create%20a%20DDL%20that%20includes%20just%20those%20same%20mailboxes%20(-RecipientFilter%20%7B(RecipientTypeDetails%20-eq%20%22MailUser%22)%20-and%20(AddressListMembership%20-like%20%22%5CAll%20Rooms*%22)%7D)%20I%20don't%20get%20the%20same%20thing.%26nbsp%3B%20Since%20AddressListMembership%20is%20an%20array%20and%20not%20a%20string%2C%20the%20-like%20comparison%20isn't%20working.%26nbsp%3B%20If%20I%20can%20create%20a%20DDL%20with%20just%20the%20rooms%2C%20I%20should%20be%20able%20to%20reverse%20that%20and%20create%20a%20DDL%20that%20excludes%20the%20rooms.%26nbsp%3B%20This%20isn't%20an%20issue%20if%20the%20rooms%20are%20in%20O365%20as%20I%20can%20limit%20that%20using%20RecipientTypeDetails%20-eq%20%22UserMailbox%22%20and%20on-prem%20with%20RemoteUserMailbox.%26nbsp%3B%20It's%20the%20issue%20with%20O365%20having%20everything%20as%20a%20mail%20user%20as%20the%20recipient%20type%20and%20recipient%20type%20details%20vs.%20on-prem%20breaking%20that%20out%20to%20what%20type%20of%20remote%20mailbox%20it%20is.%26nbsp%3B%20Any%20help%20would%20be%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-286582%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHybrid%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-287170%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic%20DL%20Filter%20on%20Address%20List%20Membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287170%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20did.%26nbsp%3B%20I%20was%20able%20to%20create%20a%20DDL%20with%20just%20the%20rooms%2C%20and%20the%20reverse%20of%20-ne%20should%20be%20excluding%20the%20rooms%20from%20a%20DDL.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-287029%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic%20DL%20Filter%20on%20Address%20List%20Membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287029%22%20slang%3D%22en-US%22%3E%3CP%3EYou're%20welcome%20%3A)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20take%20it%20it%20works%20for%20your%20scenario%3F%20I%20only%20bothered%20to%20check%20it%20against%20Get-Recipient.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-286907%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic%20DL%20Filter%20on%20Address%20List%20Membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-286907%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%3C%2FP%3E%3CP%3ETHANK%20YOU!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-286797%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic%20DL%20Filter%20on%20Address%20List%20Membership%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-286797%22%20slang%3D%22en-US%22%3E%3CP%3EI%20guess%20you%20missed%20the%20part%20where%20the%20AddressListMembership%20only%20works%20against%20the%20DistinguishedName%20attribute.%20Try%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E(Get-AddressList%20%22%5CAll%20Rooms%22).DistinguishedName%3C%2FP%3E%0A%3CP%3EGet-Recipient%20-RecipientPreviewFilter%20%7BAddressListMembership%20-eq%20'CN%3DAll%20Rooms%2CCN%3DAll%20Address%20Lists%2CCN%3DAddress%20Lists%20Container%2CCN%3DConfiguration%2CCN%3Dtenant.onmicrosoft.com%2CCN%3DConfigurationUnits%2CDC%3DEURPR03A001%2CDC%3Dprod%2CDC%3Doutlook%2CDC%3Dcom'%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I am trying to create a new dynamic DL in exchange online that will include on-prem and online users.  I know to do that the recipienttype "mailuser" has to be included.  The issue with that is all mailboxes on-prem are mail users in O365 including rooms and shared mailboxes.  I'd like to exclude these as much as possible.  I know that I can include "AddressListMembership" in the recipient filter, but I am struggling with that.  I'd like to exclude any user that is included in the address list "\All Rooms".  If I run the command "Get-MailUser -ResultSize Unlimited | ? {$_.AddressListMembership -match "All Rooms"}", I only get rooms back that are on-prem.  Handy - that's what I was going for.  But if I try to create a DDL that includes just those same mailboxes (-RecipientFilter {(RecipientTypeDetails -eq "MailUser") -and (AddressListMembership -like "\All Rooms*")}) I don't get the same thing.  Since AddressListMembership is an array and not a string, the -like comparison isn't working.  If I can create a DDL with just the rooms, I should be able to reverse that and create a DDL that excludes the rooms.  This isn't an issue if the rooms are in O365 as I can limit that using RecipientTypeDetails -eq "UserMailbox" and on-prem with RemoteUserMailbox.  It's the issue with O365 having everything as a mail user as the recipient type and recipient type details vs. on-prem breaking that out to what type of remote mailbox it is.  Any help would be appreciated.

4 Replies
Highlighted

I guess you missed the part where the AddressListMembership only works against the DistinguishedName attribute. Try this:

 

(Get-AddressList "\All Rooms").DistinguishedName

Get-Recipient -RecipientPreviewFilter {AddressListMembership -eq 'CN=All Rooms,CN=All Address Lists,CN=Address Lists Container,CN=Configuration,CN=tenant.onmicrosoft.com,CN=ConfigurationUnits,DC=EURPR03A001,DC=prod,DC=outlook,DC=com'}

Highlighted

You're welcome :)

 

I take it it works for your scenario? I only bothered to check it against Get-Recipient.

Highlighted

It did.  I was able to create a DDL with just the rooms, and the reverse of -ne should be excluding the rooms from a DDL.

Related Conversations
Filter UI shows ID SharePoint
Mell_i in SharePoint on
0 Replies
SharePoint 2013 LIst Filters (by latest date)
dmphil in SharePoint on
0 Replies
SharePoint Lists - Expanded View Roadmap ID: 57302
Kotus-Tech in SharePoint on
12 Replies
Multi-value fields display no separator
Florian Hein in SharePoint on
1 Replies