Have this script to get me Existing AD user but how can I get results to a file
$UserCSV = Import-Csv C:\temp\test.txt
Foreach ($User in $UserCSV)
# Use "EA Stop" to ensure the exception is caught.
$U = Get-ADUser $User.sAMAccountName -ErrorAction Stop
Write-output "$($User.SamAccountName) exist in domain"
# The user was not found!
Write-Warning "$($User.SamAccountName) was not found in this domain!"
# Some other terrible error occured!