Question: I'm trying to script something where I can get the email address of all users in an active directory security group.

What I have so far:

```
$Groups = Get-ADGroup -filter {Name -like "VIPEmail" } | Select-Object Name
ForEach ($Group in $Groups) {
  Get-ADGroupMember -identity $($group.name) -recursive | Select-Object samaccountname
}

```

Obviously this will only return the samaccountname, which it does. I replace samaccountname with EmailAddress, and it does nothing.

Answer: 
To keep with your original formatting so you can see where you went wrong:

```
$Groups = Get-ADGroup -filter {Name -like "09-Admins" } | Select-Object Name
ForEach ($Group in $Groups) {
   Get-ADGroupMember -identity $($group.name) -recursive | Get-ADUser -Properties mail | Select-Object mail
}

```

The problem is that you are trying to read a property that the Get-ADGroupMember return type doesn't have (Microsoft.ActiveDirectory.Management.ADPrincipal). You need to pipe that return into Get-ADuser AND specify that you want it to pull the emailaddress property. Get-ADUser will not pull most properties of a user by default, so you need to specify any additional properties you would like to retrieve (or just select all of them with "-Properties \*", but that's kind of sloppy).

Mjolinor beat me to the answer, but I figured it was worth elaborating a little on his response.
I'd add unique. So when a user is in more groups only one email is shown:

```
Get-ADGroup -filter {Name -like "RO*" } | 
Get-ADGroupMember -Recursive | 
select -Unique| 
get-adUser -Properties mail |
select -ExpandProperty Mail

```