compare object, what am i missing?

by Sep 18, 2012

Hi all, im new to the whole powershell game, but im trying to set aside an hour of my day to do something with powershell… to try and learn


yesterday i though i was going to compare the members of an AD group with the members of an Exchange distribuition list

so i started off with

get-adgroupmember 'group' | select name

this will reture a list of names like this:

Surename, Firstname

then (after spending some time downloading / installing exchange management tools) i did a 

Get-DistributionGroupMember 'list' | select Name


and the results are the same:

Surename, Firstname


ok then, all i have to do is to compare the two, or so i thought…

compare-object -referenceobject $ad -differenceobject $ex

the result of this produces something like this: (yes i have set the strips above as $ad and $ex)


@{name=Surename, Firstname}


what am i missing here? 


if i save the output from $ad and $ex to files and compare the content of the textfiles, i get the result i wanted…. why cant i get that result onscreen?