Get-ADGroupmember showing no results.

Welcome Forums General PowerShell Q&A Get-ADGroupmember showing no results.

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

 
Participant
3 years, 1 month ago.

  • Author
    Posts
  • #31234

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

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

  • #31247

    Participant
    Points: 0
    Rank: Member

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

  • #31248

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

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

    Also, I am assuming you have appropriate permissions?

  • #31260

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

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

  • #31280

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

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

  • #31309

    Participant
    Points: 0
    Rank: Member

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

  • #31311

    Participant
    Points: 0
    Rank: Member

    Thank you Tim E Lane

The topic ‘Get-ADGroupmember showing no results.’ is closed to new replies.