Hi,
I'm trying to export list of ManagedBy configuration for all Exchange OnPremise DL in a CSV, directly with the primarysmtpaddress for all mailbox set in managedby.
By default we have only the identity, and i can't use this information in Office 365.
I have try with different script, but i can't have the primarysmtpaddress.
This one give me only the primarysmtpaddress for the last DL in the list :
Get-DistributionGroup | Select Name,@{n="managedby";e={(Get-mailbox ($_ | select -ExpandProperty Managedby).name) | select -expandproperty primarysmtpaddress}}
This one work but export only the name of the managedby:
Get-DistributionGroup | Select Name,@{n="managedby";e={(($_ | select -ExpandProperty Managedby).name)}} | Export-csv c:\temp\DLSet.csv
Did you have a solution?
Thanks,