Jul 14 2022 10:48 AM
I have a specific group that has multiple groups as members. I need to pull a list of the member groups along with the gidNumber attribute for each of those groups. I can run the following line but while it does produce a column for gidNumber that column is blank.
Get-ADGroupMember -Identity Executives | select Name, gidNumber | Sort-Object -Property gidNumber
What's the best way of handling this, do I need to run a for loop in order to pull the information from each of the members?
Jul 14 2022 11:12 AM - edited Jul 14 2022 11:31 AM
SolutionGidnumber is not present as output of the Get-ADGroupMember, it is present when running (Get-ADgroup executives -properties *).member (or .members)
Jul 14 2022 11:45 AM
@Harm_Veenstra
Thanks, I ended up doing this and it seems to be working.
(Get-ADgroup Executives -properties *).member | Get-ADGroup -Properties DisplayName,gidNumber | select DisplayName,gidNumber
Jul 15 2022 12:29 AM
Jul 14 2022 11:12 AM - edited Jul 14 2022 11:31 AM
SolutionGidnumber is not present as output of the Get-ADGroupMember, it is present when running (Get-ADgroup executives -properties *).member (or .members)