Pull list of domains, and list of users, search by -like givenname and -eq Surname, output to csv if exists and enabled status
<p>I am a bit of a newb, self teaching myself powershell for an IAM role. I was asked for termination testing, to create a powershell script to check a list of users for their existence in a provided list of domains, and output a csv containing their Given Name, Surname, Server, Exists, Enabled, and. account ID.  Here is what I have so far. I'm fumbling on the split as each user outputted is the first, as well as setting up proper output. Any help is much appreciated!</p>

<pre><code>$servers = ".\serverlist.txt"
$users = ".\userlist.txt"
$outfile = ".\findings.csv"

Foreach ($server in $servers) {

    Foreach ($user in $users) {

      $User = Get-ADUser -Server $server -Filter "GivenName -like '$FirstName*' -and Surname -like '$LastName*'" -properties * |select name,givenname, sn,enabled 

      If ($User -eq $Null) {$FirstName + " " + $Lastname +  "False $server"| Add-Content $outfile}
      Else {$FirstName + " " + $LastName + "True, $server" | Add-Content $outfile}     

    }
}
</code></pre>