title: Powershell - Append Group Name and Members
body: <p>I am trying to write a script that will create a CSV file with the name of the group and its members.  My script fails with the error:</p>
  
  <p>The appended object does not have a property that corresponds to the following column</p>
  
  <p>I am sure it is a simple mistake and I'd bang away at it but I need the data quickly.</p>
  
  <pre><code>$SearchBase = "OU=Groups,DC=domain,DC=local"
  
  $SPGroups = Get-ADGroup -filter * -SearchBase $SearchBase | select name
  
  Foreach ($i in $SPGroups){
      #$Members += get-ADGroupMember -Identity $i.name | select name
      $i.name | Export-Csv -append -Path c:\bin\membersof.csv
      get-ADGroupMember -Identity $i.name | select name | Export-CSV -append -Path c:\bin\membersof.csv
      }
  </code></pre>
  
  <p>Thank You!</p>