0

I try to compare two Arrays of user accounts and I'd like to find the unique accounts.

Array number one contains following data:

PS C:\Users\admin...\Desktop> $ExcludedUsers

Name                                                                               RecipientType                                                                   
----                                                                               -------------  
Desiree AebyADC-695636344                                                          User  

Array number two contains following data:

PS C:\Users\admin...\Desktop> $AllUsers
Name                                                                               RecipientType 
----                                                                               ------------- 
Dejan Schwitter                                                                    User    
Aristoteles Filipe                                                                 User   
Desiree AebyADC-695636344                                                          User  

The magic should be done by following command:

Compare-Object -ReferenceObject $ExcludedUsers -DifferenceObject $AllUsers -IncludeEqual

The result is confusing...

InputObject                                                                        SideIndicator  
-----------                                                                        -------------  
cl03.../.../Lernende/_ToBeDeleted/Desiree AebyADC-695636344          ==      
cl03.../.../Lernende/KBA2a/Aristoteles Filipe                        =>    
cl03.../.../Lernende/_ToBeDeleted/Desiree AebyADC-695636344          =>    

If I do the same with following arrays, I get the right result (4,5)...

PS C:\Users\admin...\Desktop> $a1 = @(1,2,3) 
PS C:\Users\admin...\Desktop> $a2 = @(1,2,4,3,5) 

Where is the mistake? Any Idea?

Alex O.
  • 1
  • 1

0 Answers0