I am completely stuck! Hoping someone can help point out what I'm doing wrong. PS script below.
For testing I have 2 users in "newusers.csv" and the same 2 users in "currentmembers.csv". These are teh same file just renamed. Results of script are that the 2 users in "newusers.csv" are NOT members of "currentmembers.csv". This is obviously wrong but I can't figure out what is wrong with the script.
$list = Import-Csv newusers.csv
$members = Import-Csv currentmembers.csv
foreach ($UPN in $list) {
If ($members-Contains $UPN.upn) {
Write-Host $UPN.upn "is member"
} Else {
Write-Host $UPN.upn "is not a member"
}}
Results user 1 is not a member user 2 is not a member