Well, that makes for shorter code.
If I assume that duplicate AD users aren't a problem (although I think will be) and that a mailNickName is placed into the "FirstName" column of the CSV then you should be able to use that to shorten the list of "bad" users by adding an additional condition to the filter..
Import-CSV c:\junk\newusers.csv |
ForEach-Object {
[array]$x = Get-ADUser -Filter "(givenname -eq $($_.firstname) -and surname -eq $($_.lastname)) -or (mailNickname -eq $($_.firstname))"
if ($x.count -eq 0) {
[PSCustomObject]@{
FirstName = $_.firstname
LastName = $_.lastname
Error = "no user exists that matches either the first and last name, or whose mailNickname matches the first name"
}
}
} | Export-Csv c:\junk\badusers.csv -NoTypeInformation