title: Csv empty to export custom attribute from ad users
body: <p>From csv file, no problem in powershell console to see the value of the attribute but when I want to export in csv file, the file is empty, maybe someone could help me please ?</p>
  
  <pre><code>$adusers = Import-Csv "c:\temp\adusers.csv" -Delimiter ";"
  
  foreach ($item in $adusers) {
  # Map variables from CSV
  $adusers = $item.'ADUsers'
  $Servers = $item.'Domain'
  
  
  Get-ADUser -identity $adusers -Properties flags -Server $Servers | Select- 
  Object -Property samaccountname, userprincipalname, flags | export-csv 
  c:\temp\fdfdrff.csv -Encoding Unicode
  
  }
  </code></pre>
  
  <p>File adusers.csv:</p>
  
  <pre><code>ADUsers;Domain
  account1;Domain1
  account2;Domain2
  account3;Domain3
  account4;Domain4
  account5;Domain5
  account6;Domain6
  account7;Domain7
  account8;Domain8
  account9;Domain9
  </code></pre>
  
  <p>The output file :</p>
  
  <pre><code>"#TYPE Selected.Microsoft.ActiveDirectory.Management.ADUser"
  "samaccountname","userprincipalname","flags"
  "account9","account9@Domain9.local",
  </code></pre>