Get-ADGroupMember with all user properties

Welcome Forums General PowerShell Q&A Get-ADGroupMember with all user properties

This topic contains 4 replies, has 4 voices, and was last updated by

 
Participant
5 years, 1 month ago.

  • Author
    Posts
  • #11430

    Participant
    Points: 0
    Rank: Member

    how do i get for each user in the group which i get from "Get-ADGroupMember", all the properties of the user which the "Get-ADGroupMember" dont return?

  • #11431

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    You would most likely use a Foreach loop to enumerate each user, and retrieve their full user object from the directory.

  • #11432

    Member
    Points: 0
    Rank: Member

    Pipe the resulting objects to Get-ADUser (though it's probably a good idea to make sure you're actually looking at a user object first), like so:

    Get-ADGroupMember -Identity SomeGroup |
    Where-Object { $_.objectClass -eq 'user' } |
    Get-ADUser -Properties *
    
  • #11445

    Participant
    Points: 0
    Rank: Member

    thanks Dave!

  • #11551

    Participant
    Points: 0
    Rank: Member

    While that may work 'ok', you may want to try to leverage Quest ActiveRoles plug-ins for PowerShell if AD Web Services is enabled or running in your environment.

    Get-QADGroupMember 'Group Name' | Get-QADUser -IncludeAllProperties | Select-Object -Property *

The topic ‘Get-ADGroupMember with all user properties’ is closed to new replies.