locked
Properties of get-ADGroupMember RRS feed

  • Question

  • I am trying to understand the difference in commands?

    if i run:

    Get-ADUser user ....i get a list of properties.

    Get-ADUser <user> -Properties * | Get-Member.....gives me all the hidden??? or non default "what is the correct" properties.

    get-adgroupmember group gives me 6 properties i can query. distinguishedName, name, distinguishedName, distinguishedName, distinguishedName, SID.

    Are there more? If there is how can i see it?

    Trying to learn and understand.

    Thanks for the help.,

    Tuesday, December 2, 2014 10:24 PM

Answers

  • The Get-ADGroupMember does not support the -Properties parameter, so it can only be used to retrieve the 6 default properties. To get additional properties you could pipe the results to a cmdlet that supports the -Properties parameter, like Get-ADObject.

    Richard Mueller - MVP Directory Services

    • Marked as answer by Ogeccut Wednesday, December 3, 2014 1:44 PM
    Wednesday, December 3, 2014 3:23 AM

All replies

  • The Get-ADUser cmdlet includes a -Properties parameter that allows you to return some or all of the non-standard, or extended, properties, in addition to the standard properties. This parameter is mildly common with AD cmdlets. To get a list of the AD cmdlets that include the -Properties parameter use the Get-Command cmdlet.

    Get-Command -ParameterName Properties -Module ActiveDirectory

    • Proposed as answer by jrv Wednesday, December 3, 2014 2:18 AM
    Tuesday, December 2, 2014 10:54 PM
  • The Get-ADGroupMember does not support the -Properties parameter, so it can only be used to retrieve the 6 default properties. To get additional properties you could pipe the results to a cmdlet that supports the -Properties parameter, like Get-ADObject.

    Richard Mueller - MVP Directory Services

    • Marked as answer by Ogeccut Wednesday, December 3, 2014 1:44 PM
    Wednesday, December 3, 2014 3:23 AM
  • To get a list of properties of the members, you can throw the results into a loop:

    Get-ADGroupMember "GroupName" -Recursive | Foreach-Object ({ Get-ADUser $($_.samaccountname) -properties * | Format-Table Name,Whatever,Property,You,Want,To,See -auto })

    If you're looking for whether a group member is enabled/disabled or stale, you can use a tool I have in the gallery:

    https://gallery.technet.microsoft.com/Get-Group-Members-Status-dc38e36d


    - Chris Ream -

    **Remember, if you find a post that is helpful, or is the answer, please mark it appropriately.**

    Wednesday, December 3, 2014 4:01 AM
  • I know this is an old thread but it's very useful.  I needed just the name and the job tile of every group member of a distribution group.  Modified it a bit to get separate columns in a spreadsheet.

    Get-ADGroupMember "dg_name" -Recursive | Foreach-Object ({ Get-ADUser $($_.samaccountname) -properties name,title}) | Export-Csv -path C:\Users\name\Desktop\name_of_file.csv -NoTypeInformation                             

    Now,  it didn't just give me the name and title but it put several items in separate columns making it much easier to edit/hide columns I didn't need.

    Wednesday, January 8, 2020 4:24 PM