diff --git a/Update-StaffAD.ps1 b/Update-StaffAD.ps1 index e0e2974..2b83db1 100644 --- a/Update-StaffAD.ps1 +++ b/Update-StaffAD.ps1 @@ -66,7 +66,10 @@ foreach ($entry in $Deduped.Values) { -ErrorAction Stop } catch { $notFound++ - $notFoundList += $samAccount + $parsedName = if ($email -match "^([^.]+)\.([^@]+)@") { + "$($Matches[1]) $($Matches[2])" + } else { "Unknown" } + $notFoundList += "$samAccount, $parsedName" continue }