Get-ADGroupmember showing no results.

This topic contains 14 replies, has 4 voices, and was last updated by  Carrie Nohl 1 year, 11 months ago.

  • Author
    Posts
  • #31234

    Carrie Nohl
    Participant

    I have been trying to get a list of members to an AD Security Group. I have tried every combination I can think of but nothing is working. It all comes back with no results. I think the problem is that my group name has (BCC) in it. For example the group name is "Family members – including non clients (BCC)". I am trying to export the list of active directory members to this group to a csv file. I have used get-adgroup and piped that into get-adgroupmember and piped that into export-csv. I have used get-adgroupmember in many different combination. I have also used a couple of my commands with a different group and it gives me a partial list of members for that group. I have aslo tried get-adgroup -Identity "GUID"

    I have used as simple of cmds as 'Get-ADGroupmember -identity "Family Members – Including Non Clients (BCC Only)" ' Just to get the list to display on the screen and that didn't even work. It did not give me an error but it did not return any results either.

    I am totally out of ideas. Anyone can help that would be great.

  • #31241

    Meddy Med
    Participant

    HI Carrie,

    What happened when you type this in?

    Get-ADGroupMember 'GroupName' | Select-Object name

    If you get a list of users, as you should..you can than export | export-csv C:\somefile.csv

  • #31246

    Carrie Nohl
    Participant

    It just returned to the PS command prompt with no results and no errors.

  • #31247

    Meddy Med
    Participant

    have you tried different groups? I am assuming the group is not empty?

  • #31248

    Carrie Nohl
    Participant

    Group is not empty. and I just tried your command with another group and the same thing happened.

    I just tried your command with a different group then the previous two groups and it gave names.

    Does it matter that the members in the security group are contacts? They are not users but they are contacts.

    Carrie A Gale.

  • #31257

    Meddy Med
    Participant

    can you run this please?
    (Get-ADGroupMember 'FsMarketingRw').count

    I am thinking that you might have too many objects in it, and its causing issues.

    let's see if it can get a count!

    sorry I am also working trying to respond when I can.

  • #31258

    Carrie Nohl
    Participant

    I got a reply of 0.

    But in AD Users and Computers there are tons of contact names under the Members tab

    Do I need to put the server name in there?

  • #31259

    Meddy Med
    Participant

    Sorry, enter your group between the quotes, that was a local group for me! sorry!

    Also, I am assuming you have appropriate permissions?

  • #31260

    Carrie Nohl
    Participant

    I entered my groups and included the -server name and it still returns a 0

    which makes no sense because there is probably 100 contacts in this Global Security Group.

    Other groups with less contacts seem to give me results but not this group or other groups this big.

    I am a Domain Admin on this domain

  • #31275

    Curtis Smith
    Participant

    Yes, it absolutely matters that the group members are contacts. Get-ADGroupMember only returns user objects unfortunately. You should be able to get what you want using Get-ADObject however.

    Get-ADObject -filter "cn -eq 'groupname'" -Properties member | select -ExpandProperty Member
    
  • #31279

    Carrie Nohl
    Participant

    OH WOW, Thanks so much. This has been driving me crazy but your command works great.

  • #31280

    Curtis Smith
    Participant

    NP, but I do need to retract part of my previous statement. Get-ADGroupMembers returns User and Computer objects, but not Contacts. Just for clarification.

  • #31307

    Carrie Nohl
    Participant

    can you tell me what cn-eq means in the command?

  • #31309

    Tim E Lane
    Participant

    Hi Carrie,
    'cn' refers to the Common-Name of the AD object, in this case a group
    '-eq' equal to

  • #31311

    Carrie Nohl
    Participant

    Thank you Tim E Lane

You must be logged in to reply to this topic.