title: Removing all Members in a Distribution Group
body: <p>I'm trying to delete all the members of a distribution group without deleting the group as a while. I found another stackoverflow post where this seemed to do the trick:</p>
  
  <pre><code>foreach ($member in Get-DistributionGroupMember -Identity Auto.test@company.com) 
  {
    write-host $member
    Remove-DistributionGroupMember -Identity Auto.test@company.com -Member $member -Confirm:$False
  }
  </code></pre>
  
  <p>However, it won't delete the users. It says this for every user it tries to delete...</p>
  
  <p>Cannot process argument transformation on parameter 'Member'. Cannot convert value "Smith, John" to type "Microsoft.Exchange.Configuration.Tasks.GeneralRecipientIdParameter". Error: "Cannot convert hashtable to 
  an object of the following type: Microsoft.Exchange.Configuration.Tasks.GeneralRecipientIdParameter. Hashtable-to-Object conversion is not supported in restricted language mode or a Data section."</p>
  
  <p>I'd think 'name' would be a a property remove-distributiongroupmember would take, but it doesn't seem like it wants to here.</p>
  
  <p>So I tested this: </p>
  
  <pre><code>Remove-DistributionGroupMember -Identity Auto.Test@company.com -Member 'Smith, John'
  </code></pre>
  
  <p>And it works! It deletes the user just fine when I input the name manually. So what am I doing wrong?</p>