I have a situation with employee records. I have few libraries with active employees records. and I have 2 libraries that contain terminated employees records. The idea is when someone is terminated then move her/his records from active library to terminated library.

The HR users copied records from Active to Terminated libraries instead of MOVING the items. Now I need to find out employees in both libraries. How do I do this?


You can use

  1. PowerShell script to iterate the library items and compare
  2. You can export both libraries into Excel, then merge the two files, the sort it to find duplicates.
  • Great. I wish it could create a page and give user UI to view these items. But powershell or excel would work. thanks Amal
    – Jason Baig
    Jan 12 '15 at 18:13
  • Yes you can look into linked data source in sharepoint designer. And then add it to a page. Jan 12 '15 at 18:14

You can try the below powershell:

$mSite = Get-SPweb "http://sharepointed.com/site/taco"
$aList = $mSite.lists["A"]
$bList = $mSite.lists["B"]

$arrA = @()
$arrB = @()

foreach($iA in $aList.Items)
 $arrA += $iA["Title"]

foreach($iB in $bList.Items)
 $arrB += $iB["Title"]

$c = Compare-Object -ReferenceObject $arrA -DifferenceObject $arrB -PassThru
Write-Host $c

Source: http://www.sharepointed.com/2012/10/02/use-powershell-to-compare-two-sharepoint-lists/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.