SOLVED

Using MS Teams group in Exchange Online mail rule.

%3CLINGO-SUB%20id%3D%22lingo-sub-2176765%22%20slang%3D%22en-US%22%3EUsing%20MS%20Teams%20group%20in%20Exchange%20Online%20mail%20rule.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2176765%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20build%20a%20mailflow%20rule%20based%20on%20a%20group%20membership%2C%20however%20I%20would%20like%20this%20group%20to%20be%20MS%20Teams%20groups%2C%20so%20if%20a%20user%20is%20a%20member%20of%20X%20Team%2C%20rule%20will%20apply%2C%20however%20I%20am%20not%20able%20to%20see%20any%20Team%20group%20on%20a%20list.%20I%20have%20securityenabled%20this%20group%20-%20no%20luck%2C%20still%20not%20there.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20anyone%20aware%20of%20if%2Fhow%20this%20can%20be%20achieved%3F%20Basically%20what%20I%20would%20like%20to%20have%20is%20a%20mail%20rule%20based%20on%20a%20group%20membership%20where%20users%20would%20be%20able%20to%20add%20themselves%20(and%20only%20themselves)%20there%20and%20remove%20as%20well%20-%20so%20they%20can%20decide%20whether%20the%20solution%20works%20for%20them%20or%20not.%20I%20was%20thinking%20about%20Team%20membership%20-%20easy%20for%20users%20to%20add%20and%20remove%20themselves.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%20appreciated%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%2C%3C%2FP%3E%3CP%3EJ%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2176765%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ems%20teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2176908%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20MS%20Teams%20group%20in%20Exchange%20Online%20mail%20rule.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2176908%22%20slang%3D%22en-US%22%3EAccording%20to%20the%20documentation%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fsecurity-and-compliance%2Fmail-flow-rules%2Fconditions-and-exceptions%23recipients%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fsecurity-and-compliance%2Fmail-flow-rules%2Fconditions-and-exceptions%23recipients%3C%2FA%3E)%2C%20M365%20Groups%20should%20be%20supported%20for%20this%20condition%2C%20however%20the%20UI%20bits%20in%20the%20EAC%20do%20not%20expose%20them%2C%20so%20you%20will%20have%20to%20use%20PowerShell.%20Refer%20to%20the%20article%20above%20for%20the%20exact%20parameter%20you%20need%20(most%20likely%20-FromMemberOf).%3C%2FLINGO-BODY%3E
Contributor

Hi Everyone,

 

I would like to build a mailflow rule based on a group membership, however I would like this group to be MS Teams groups, so if a user is a member of X Team, rule will apply, however I am not able to see any Team group on a list. I have securityenabled this group - no luck, still not there.

 

Is anyone aware of if/how this can be achieved? Basically what I would like to have is a mail rule based on a group membership where users would be able to add themselves (and only themselves) there and remove as well - so they can decide whether the solution works for them or not. I was thinking about Team membership - easy for users to add and remove themselves.

 

Any ideas appreciated,

 

Cheers,

J

2 Replies
best response confirmed by Pawel Jarosz (Contributor)
Solution
According to the documentation (https://docs.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/conditions-and-exc...), M365 Groups should be supported for this condition, however the UI bits in the EAC do not expose them, so you will have to use PowerShell. Refer to the article above for the exact parameter you need (most likely -FromMemberOf).
Dear Vasil!! It worked out! If you ever in Poland (Wroclaw city) give me a shout we go for a beer! Few words of explanation why I am interested in this - wanted to give ability for people for have certain dislaimers added to their emails if they add themselves to the group.