Hello,
This is a small part of a much larger script, but when I test this portion I receive some unexpected output from the exchange management shell.
Basically this script reads a csv file, assigns the distribution groups "Identity" to a variable" and passes that variable to a query to get the groups manager. As of right now I'm just echoing the manager to validate.
I would expect a list of managers, but what I get is...
Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartD
ata Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEn
dData Microsoft.PowerShell.Commands.Internal.Format.FormatEndData
$csv = import-csv "xxxx.csv" foreach($object in $csv) { $groupName = $object.MailingList $groupOwner = Get-DistributionGroup -Identity $groupName | Format-List ManagedBy Echo "$groupOwner" }
I think this has do do with the formatting of the list, but I'm pretty new at this and am not too sure how to resolve this. Any help would be great.