Link to home
Start Free TrialLog in
Avatar of Ernesto Gallardo
Ernesto GallardoFlag for United States of America

asked on

How to get all Distribution Groups where a security Group is configured as Allowed to send

Hi,
I'm migrating security groups to O365 and I need a script that could give me all the distribution Groups where "securitygroupX " is configured as the only group allowed to send to them (AcceptMessagesOnlyFromDLMembers)
Thanks,

I used this , but it returned an  empty file:
Get-DistributionGroup |Where-Object {$_.AcceptMessagesOnlyFromDLMembers -eq "BarryAdvisors-Senders"} | Export-csv C:\DG-Migration\BAS.csv
ASKER CERTIFIED SOLUTION
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ernesto Gallardo

ASKER

Again,  empty file:
PS C:\DG-Migration> Get-DistributionGroup |Where-Object {$_.AcceptMessagesOnlyFromDLMembers  -like  "CNHSStudents-Senders@barry.edu"} | Export-csv C:\DG-Migration\BAS.c
sv
WARNING: By default, only the first 1000 items are returned. Use the ResultSize parameter to specify the number of items returned. To return all items, specify
"-ResultSize Unlimited". Be aware that, depending on the actual number of items, returning all items can take a long time and consume a large amount of memory. Also,
we don't recommend storing the results in a variable. Instead, pipe the results to another task or script to perform batch changes.
PS C:\DG-Migration>
Thanks Adam,
It worked at the end, for most of the groups.