title: Using Get-ADUser with Import-Csv for future expansion to update user using Set-ADUser
body: <p>At the end of this project, I am trying to use a CSV file to update users personal details within AD. I plan to use Get-ADUser piped into Set-ADUser</p>
  
  <p>My current problem is returning the user records from AD using Get-ADUser</p>
  
  <p>My CSV file is as follows</p>
  
  <pre><code>FirstName,LastName,DisplayName,CompanyName,EmailAddress
  John,Doe,John Doe,Test Company,john.doe@company.com
  Jane,Doe,Jane Doe,Test Company,jane.doe@company.com
  </code></pre>
  
  <p>My PowerShell script looks like this</p>
  
  <pre><code>Import-Csv .\Users.csv | ForEach {
  
  Write-Host $_.EmailAddress
  Write-Host $_.DisplayName
  
  "`"$($_.EmailAddress)`""
  
  Get-ADUser -Filter { userPrincipalName -eq "`"$($_.EmailAddress)`""}
  }
  </code></pre>
  
  <p>What is returned is</p>
  
  <pre><code>john.doe@company.com
  John Doe
  "john.doe@company.com"
  jane.doe@company.com
  Jane Doe
  "jane.doe@company.com"
  </code></pre>
  
  <p>Running Get-ADUser without using variables like below, returns the user account as it should, whereas the above code does not.</p>
  
  <pre><code>Get-ADUser -Filter { userPrincipalName -eq "john.doe@company.com"}
  </code></pre>
  
  <p>Where am I going wrong?</p>