Get-AdGroupMember name and phone number

Feldfoss, Thomas 21 Reputation points
2021-12-07T09:48:42.93+00:00

I need to export the members name and mobile phone number from a AD group with PowerShell.
I am using this cmdlet:
Get-ADGroupMember -identity "GroupName" -Recursive | Get-ADUser -Property DisplayName | Select Name,ObjectClass,mobile

This returns the name and ObjectClass but not the phone number.

I tried with attribute Phone, Mobile, TelephoneNumber - but the colon returns emty.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. SChalakov 10,576 Reputation points MVP Volunteer Moderator
    2021-12-07T10:08:47.96+00:00

    Hi,
    you are getting only the DisplayName of the AD User:

    155577-capture.png

    That is why the "mobile" Property is empty. Here is an easy fix for that :)

    Get-ADGroupMember -identity "GrouName" -Recursive | Get-ADUser -Property DisplayName,mobile | Select Name,ObjectClass,mobile  
    

    Hope I could help.

    ----------

    If my reply was helpful please don't forget to upvote and/or accept as answer, thank you!
    Regards,
    Stoyan

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.