I wrote a script that read all users in specific group in AD and get there SamAccountName and put them in txt file, and then get there mail box to anther txt file here is the script:
$UserList="c:\ADuser.txt"
Clear-Content $UserList
# mail.txt >> list of users emails
$MailList="c:\mail.txt"
Clear-Content $MailList
# Group Name to search in AD
$GroupName="Delete_technician_MailBox"
# get user list "Members" group ONLY USERS and put the list in $UserList
Get-ADGroupMember $GroupName | where {$_.objectClass -eq "user"}| foreach {$_.SamAccountName}| Out-File $UserList
# Every line in $UserList I get the user MailBox and put it in $MailList
ForEach ($system in Get-Content $UserList)
{
Get-ADUser $system -Properties mail | foreach { $_.mail }| Out-File -FilePath $MailList -append
}