I would like to write a line that lets me know any usernames that could not be found and what their display name was within the .txt document that the script is pulling from.
Essentially I just want a line to add onto the existing script.
Any tips or guidance on how to do so would be much appriciated.
Get-Content C:\Users\User\Desktop\findusername.txt | Foreach-Object {get-aduser -filter "displayName -like '$($_)'" | Select-Object SamAccountName} | Export-Csv -Path C:\Users\User\Documents\ADGroupusernames.csv -NoTypeInformation