Get-ADGroupMember可以获取用户详细信息吗?

时间:2017-07-26 09:30:47

标签: powershell active-directory

我用它来获取特定AD组中的所有用户:

$names = Get-ADGroupMember -identity "a" -Recursive | select name

我也有兴趣获取相应的电子邮件地址,有没有办法通过Get-ADGroupMember实现这一目标?

我试过这个,但这并没有帮助:

$names = Get-ADGroupMember -identity "a" -Recursive | select mail

1 个答案:

答案 0 :(得分:2)

试试这个:

Get-ADGroupMember -Identity Administrators -Recursive | Get-ADUser -Properties *  | Select SamAccountName,mail,EmailAddress