EXO - Find All Mail Enable Security Groups with a Prefix

%3CLINGO-SUB%20id%3D%22lingo-sub-2804654%22%20slang%3D%22en-US%22%3EEXO%20-%20Find%20All%20Mail%20Enable%20Security%20Groups%20with%20a%20Prefix%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2804654%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20a%20list%20of%20all%20distributions%20groups%20in%20Exchange%20Online%20that%20has%20a%20Mail%20Enabled%20Security%20group%20that%20starts%20with%20the%20prefix%20%22MESG-%22.%26nbsp%3B%20I%20have%20a%20Hybrid%20environment%20with%20over%202000%20DLs%20that%20need%20to%20be%20searched.%26nbsp%3B%20I%20am%20not%20a%20powershell%20guru%20so%20if%20you%20can%20keep%20it%20pretty%20basic%20that%20will%20be%20GREAT.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2804654%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2805731%22%20slang%3D%22en-US%22%3ERe%3A%20EXO%20-%20Find%20All%20Mail%20Enable%20Security%20Groups%20with%20a%20Prefix%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2805731%22%20slang%3D%22en-US%22%3EA%20simple%3CBR%20%2F%3E%3CBR%20%2F%3EGet-DistributionGroup%20MESG-*%20-ResultSize%20Unlimited%3CBR%20%2F%3E%3CBR%20%2F%3Eshould%20do.%3C%2FLINGO-BODY%3E
New Contributor

I need a list of all distributions groups in Exchange Online that has a Mail Enabled Security group that starts with the prefix "MESG-".  I have a Hybrid environment with over 2000 DLs that need to be searched.  I am not a powershell guru so if you can keep it pretty basic that will be GREAT. 

1 Reply
A simple

Get-DistributionGroup MESG-* -ResultSize Unlimited

should do.