title: Remove-DistributionGroupMember - Specify a unique user
body: <p>I am trying to remove a bunch of members from a distribution list in exchange using powershell. I originally was using the alias value to specify the members but ran into errors saying there were multiple members with a specified alias. So I am trying to use something else to uniquely id these members.</p>
  
  <p>According to <a href="http://technet.microsoft.com/en-us/library/aa996367.aspx" rel="nofollow">this</a> documentation, the Get-DistributionGroupMember has many of the same fields under identity as the <a href="http://technet.microsoft.com/en-us/library/aa998016.aspx" rel="nofollow">Remove-DistributionGroupMember</a> cmdlet has under member, but I am having trouble getting any of them other than alias to work. Here is my code so far:</p>
  
  <pre><code>foreach ($member in Get-DistributionGroupMember -Identity $selecteddl | Select-Object Alias) {
          Remove-DistributionGroupMember -Identity $selecteddl -Member $member.alias -Confirm:$False
      }
  </code></pre>
  
  <p>That is the code that produces the error of duplicate members. If I change both of the "alias" properties to "guid" I get a different error:</p>
  
  <blockquote>
    <p>Cannot process argument transformation on parameter 'Member'. Cannot
    convert the "4ed0987f-7c86-48e7-8f47-ca9ad731e2fd" value of type
    "System.Guid" to type
    "Microsoft.Exchange.Configuration.Tasks.GeneralRecipientIdParameter".
        + CategoryInfo          : InvalidData: (:) [Remove-DistributionGroupMember], ParameterBindin...mationException
        + FullyQualifiedErrorId : ParameterArgumentTransformationError,Remove-DistributionGroupMember</p>
  </blockquote>
  
  <p>Is there somthing that I should be doing differently to get around this issue?
  I am very new to powershell so I will take any additional tips you have for me. Thanks</p>