Loaded two JSON files with Get-Content filename.JSON | ConvertFrom-Json
One object name $SubscriberEmail has the property name email
The second object name $ADEnabledUsersEmail has a property named Work Email
Trying to compare both objects and find the ones, not in the $ADEnabledUsersEmail object and Write-Out the name.
Here is the current foreach method but seems to output all the emails multiple times.
foreach($S in $SubscriberEmail ){
foreach($A in $ADEnabledUsersEmail){
if($A.'Work Email' -eq $S.email ){
Write-Host "User is active"
}else{
Write-Host $s.email
}
}
}