none
Member Of Tab RRS feed

  • Question

  • Hi,

    I need to export the data in the "Members Of" Tab for a Universal Group.  I am using the Get-ADGroup cmdlet, but I am cannot find the right switch to display or export the names in the "Member Of" tab.

    Any help would be appreciated.

    Dave

    Thursday, October 13, 2016 1:58 PM

Answers

  • Hi Dave,

    This is what I'd do:

    Get-ADGroup -Filter * -SearchBase 'OU=Testing,DC=domain,DC=com' -Properties MemberOf |
        Select Name,@{N='Membership';E={$_.MemberOf -join "`r`n"}} |
            Export-Csv .\groupMemberships.csv -NoTypeInformation

    Open the output file in Excel and expand all of the columns and rows.


    Friday, October 14, 2016 4:39 PM

All replies

  • If you are really looking for the groups that this group is a member of rather than the members of this group, try Piping it to select and include the memberof property.

    get-adgroup -filter * | select name,memberof

    That will list the memberof properties for all Groups in your AD.

    I usually do not have groups that are members of other groups but ir is perfectly valid to do so.

    Hope that helps.

    Thursday, October 13, 2016 4:03 PM
  • If you are really looking for the groups that this group is a member of rather than the members of this group, try Piping it to select and include the memberof property.

    get-adgroup -filter * | select name,memberof

    That will list the memberof properties for all Groups in your AD.

    I usually do not have groups that are members of other groups but ir is perfectly valid to do so.

    Hope that helps.

    Just as a clarification, you'll need to use the -Properties parameter of Get-ADGroup to return memberOf.

    Thursday, October 13, 2016 4:15 PM
  • Thanks Mike.  I was just discovering that in testing.  I should have tested first.

    get-adgroup -filter * -properties memberof | select name,memberof

    Thursday, October 13, 2016 4:21 PM
  • Hi Mike,

    This command almost works, but the Memberof data is run together and is truncated. I need to add the -searchbase switch otherwise I was searching the entire corporation vs my segment group.  Is there any way to list the memberof data on its own line?

    Unfortunately do to past Administrators and Developer gone wild, we have groups nested within groups within groups.

    Dave

    Thursday, October 13, 2016 5:51 PM
  • So my question is: What is it you really need to know?

    -- Bill Stewart [Bill_Stewart]

    Thursday, October 13, 2016 10:35 PM
    Moderator
  • Hi Dave,

    This is what I'd do:

    Get-ADGroup -Filter * -SearchBase 'OU=Testing,DC=domain,DC=com' -Properties MemberOf |
        Select Name,@{N='Membership';E={$_.MemberOf -join "`r`n"}} |
            Export-Csv .\groupMemberships.csv -NoTypeInformation

    Open the output file in Excel and expand all of the columns and rows.


    Friday, October 14, 2016 4:39 PM
  • Bill,

    I have group A and group A is Member of about 40 different groups. I would like export the content of the "Member Of" to a csv or text file but would like the each group in the "Member Of" tab to exported to its own line in the csv or text file. The commands I have run will export the groups of to one continuous line in a csv file.

    The closest success I have found is this command:

     dsget group "CN=Group A, OU=Testing,DC=domain,DC=com" -memberof

    Thanks,

    Dave


    • Edited by D Sprangers Monday, October 17, 2016 6:15 PM
    Monday, October 17, 2016 12:30 PM
  • Right, but what problem does this solve for you? Why do you need this output?

    -- Bill Stewart [Bill_Stewart]

    Monday, October 17, 2016 2:08 PM
    Moderator
  • The boss wants to review how many groups are getting full access to department shares because of Group A. I thought outputting the Member Of tab to a txt file would be quicker that writing down 40 groups by hand.  Plus our company uses a lot nested group and I think this scrip would help us in the future with other nested group troubleshooting.

    Dave

    Monday, October 17, 2016 6:23 PM
  • This problem is solved more directly by granting permissions using groups that don't contain other groups as members. As noted in the top post in this forum, this forum is for scripting questions rather than script requests. My advice is to simplify how you grant permissions.

    -- Bill Stewart [Bill_Stewart]

    Monday, October 17, 2016 6:40 PM
    Moderator