I started with what I have below.
$user = Get-ADGroupMember -Identity mygroup
foreach ($n in $user) {
(Get-ADUser $n -Properties mail).mail
}
Here is what worked and gave me what I wanted
$user = Get-ADGroupMember -Identity mygroup
foreach ($n in $user) {
(Get-ADUser $n -Properties mail).mail | Add-Content c:\mygroup.txt
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.