Compare two Excel sheet having AD Users

This topic contains 2 replies, has 3 voices, and was last updated by Profile photo of random commandline random commandline 7 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35298
    Profile photo of Ali Asghar
    Ali Asghar
    Participant

    i want to compare two CSV files both having AD Users. e.g
    csv1 contains all users about 3000
    csv2 contains about 600

    i want a csv3 that contains CSV1 – CSV2

    #35303
    Profile photo of Wilfredo Perez
    Wilfredo Perez
    Participant

    use compare-object cmdlet. If you need help or examples use help compare-object -examples, or -full. Remember to get the content of the CSV files.

    #35304
    Profile photo of random commandline
    random commandline
    Participant
    # Export results excluding entries contained in both csv files
    $ref = Import-Csv .\adusers1.csv
    $dif = Import-Csv .\adusers2.csv
    
    Compare-Object -ReferenceObject $ref -DifferenceObject $dif | 
    select -ExpandProperty inputobject | export-csv .\adusers3.csv -NoTypeInformation
    
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.