Get-ADGroupMember with all user properties

This topic contains 4 replies, has 4 voices, and was last updated by Profile photo of Chris Stephens Chris Stephens 3 years, 7 months ago.

  • Author
    Posts
  • #11430
    Profile photo of wantto wantto
    wantto wantto
    Participant

    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
    Profile photo of Don Jones
    Don Jones
    Keymaster

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

  • #11432
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    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
    Profile photo of wantto wantto
    wantto wantto
    Participant

    thanks Dave!

  • #11551
    Profile photo of Chris Stephens
    Chris Stephens
    Participant

    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 *

You must be logged in to reply to this topic.