#Get Contents of Text File
$users = gc "C:\Scripts\UserListBatch6.txt" 

#Get Groups return by GC
$CDSGroup = ($users | Get-ADPrincipalGroupMembership -server "bhm1dc01.controlsdata.com" | select name, distinguishedName) 

$AECGroup = ($users | Get-ADPrincipalGroupMembership -server "AEC01A-DC03.aecuk.aec.local" | select name, distinguishedName) 

#Compare Groups and export result
 {compare-object -ReferenceObject $CDSGroup -DifferenceObject $AECGroup | export-csv c:\scripts\output\Groupdif.csv}