I'm writing a PowerShell script that needs to check if items in array $arrayEmail are in array $empListEmail and throw those values in another array C. Array A has 9,500+ items and array B doesn't have many. Surprisingly, I have not seen an example that performs this. I've been searching Google for two days. Here is what I have now, but the comparison doesn't work at all like it should.
function MatchUsers {
$array = Get-Content -Raw -Path PassDataOut.json | ConvertFrom-Json
Import-Module ActiveDirectory # Load the Active Directory module
Set-Location AD: # Change into Active Directory
set-location "DC=graytv,DC=corp" # Sets the location to the Gray TV Corporate directory
$empList = Get-ADUser -filter 'Enabled -eq "False"' -searchbase "OU=domain Users,DC=graytv,DC=corp"
$arrayTemp = $array.Email
$arrayEmail = $arrayTemp.trim()
$empListEmail = $empList.UserPrincipalName
$NotInList = @($arrayEmail) -notin $empListEmail
Write-Host $NotInList