title: How do I use Set-ADuser with the -Instance parameter to update an attribute to blank?
body: <p>We've been using Powershell to bulk update our AD for several years with data from a CSV file. The code is pretty straight forward:</p>
  
  <pre><code>$Empinfo = Import-CSV AFile.csv
  $EmpAD = Get-Aduser someone
  
  $EmpAD.Title = $EmpInfo.Title 
  $EmpAD.streetAddress = $Empifo.street
  $EmpAD.PostalCode = $Empifo.zip
  &lt;snip&gt;
  Set-ADUser -Instance $EmpAD
  </code></pre>
  
  <p>Recently, the street and zip info have been blanked for some people due to organizational weirdness.  When we run the same script and try to set, say streetAdress to nothing, Set-ADuser throws a "replace" error.
  (Note that I tried setting streetaddress to a single space and it still failed.)</p>
  
  <p>After much trial and error, today I was able to make it work by testing for blankness and using the following:</p>
  
  <pre><code>if (Empinfo.street -eq $null) {
       Set-ADUser $EmpAD -Clear streetaddress,postalCode
  } else {
      $EmpAD.streetAddress = $Locations[$site].street
      $EmpAD.PostalCode = $Locations[$site].zip
  }
  </code></pre>
  
  <p>In other words, we have to issue a specific -Clear action to accomplish this.
  Is this how we should expect this to work?  I cannot see anything in the -Instance parameter docs that says you cannot empty an attribute in the manner we were trying. </p>