need a script to export out all Distro groups and members from office 365
can someone provide a script that will output all Distro groups and members from O365 in this format:
Member Group
User1 distro group 1
User2 distro group 1
User3 distro group 1
User1 distro group 2
User3 distro group 2
User5 distro group 2
User1 distro group 3
User6 distro group 3
....
It will return empty groups as well. Might be a bit slow as I use UserPrincipalName as the identifier for each member, and it's calling get-user to get it. This is done because you can add non mail-enabled user to a DG as well. If you are only interested in returning mail enabled ones, it can run much faster, just replace
Open in new window
It will return empty groups as well. Might be a bit slow as I use UserPrincipalName as the identifier for each member, and it's calling get-user to get it. This is done because you can add non mail-enabled user to a DG as well. If you are only interested in returning mail enabled ones, it can run much faster, just replace
Open in new window
withOpen in new window