Welcome Forums General PowerShell Q&A Compare two Excel sheet having AD Users

Viewing 2 reply threads
  • Author
    • #35298
      Topics: 9
      Replies: 7
      Points: 0
      Rank: Member

      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
      Topics: 16
      Replies: 108
      Points: 0
      Rank: Member

      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
      Topics: 5
      Replies: 288
      Points: 229
      Helping Hand
      Rank: 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 2 reply threads
  • The topic ‘Compare two Excel sheet having AD Users’ is closed to new replies.