我用它来获取特定AD组中的所有用户:
$names = Get-ADGroupMember -identity "a" -Recursive | select name
我也有兴趣获取相应的电子邮件地址,有没有办法通过Get-ADGroupMember
实现这一目标?
我试过这个,但这并没有帮助:
$names = Get-ADGroupMember -identity "a" -Recursive | select mail
答案 0 :(得分:2)
试试这个:
Get-ADGroupMember -Identity Administrators -Recursive | Get-ADUser -Properties * | Select SamAccountName,mail,EmailAddress