header1   header
header
header : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
IMPORTANT: PowerShellCommunity.org is moving! - Wednesday, August 15, 2012

PowerShellCommunity.org is moving!  This community software, and the hardware that it sits on, are no longer serving the purposes of this community.  As a result, we have decided to move this community to a new home at PowerShell.org.  PowerShell.org is already up and running with the new community software and in its new location, so please post any new questions that you have on the forums over there instead of posting them on this site.  We've already started getting some great questions from members of the community over there so please, come on over and join us!

While we are going through this transition, this site will remain up for the short term.  New posts may no longer be created on these forums, however replies to existing posts are allowed so that users who posted questions don't have to re-post the same question on the new site.

[UPDATE 28/02/2013] New user registration has been disabled and forums have now been switched to read-only, including for existing posts since all threads that were started should now be completed. If you have a question about content on this site or about PowerShell in general, head over to PowerShell.org and ask it there where there are people actively using the site and answering questions.

If you have any questions, please let us know on the PowerShell.org site.

Thank you,

Kirk "Poshoholic" Munro

 
Assistance with Get-qadgroupmember
Last Post 23 Jan 2012 10:24 AM by Porthos. 2 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
PorthosUser is Offline
New Member
New Member
Posts:2
Avatar

--
23 Jan 2012 09:54 AM
    Hi everyone,

    Been racking my brain over this one for while...I grabbed this code off a different post here on these boards

    $csv = get-content "d:\script\input.csv" 
    $result = $csv | foreach-object { 
    $group=$_ 
    get-qadgroupmember "$_" -sizelimit 0 -indirect | select-object firstname,initials,lastname,logonname,title,department,company,P.O.Box,@{n="GroupName";e={$group}} 

    $result | export-csv d:\script\rebtest12.csv -notype 

    I am trying to get a complete listing of members in a group and all its nested groups.

    The problem I am having is the following... say  I have the following group structure and memberships...

    Group1
    User1
    -----NestedGroup1
    User1
    -----NestedGroup2
    -----NestedGroup3

    The script that I pasted lists all the members, however it strips out all but one instance of each user. So if a user is a member of Group1 and Nested1, the script only returns the user as a member of Nested1.

    I need to know when a user has redundant access.

    Thaks in Advance, Im pretty new to powershell and may be overlooking something simple.
    Scott GarrettUser is Offline
    New Member
    New Member
    Posts:32
    Avatar

    --
    23 Jan 2012 10:19 AM
    Not exactly what you are looking for but it's close.

    http://www.blackops.ca/cms/blog/?p=251

    This looks for all the groups that a user is a member of, and warns if the user is a member of a group more than once because of other group membership.
    Might give you some ideas, or you can run this per user?

    This is the bit that gives the warning
    #If we have already processed the group once then just report and remove it from the input arraywrite-Host -ForegroundColor Red $spacer([ADSI]("LDAP://"+ ($InputArray[0]))).name "- Already a member"$InputArray.remove($InputArray[0])
    
    http://www.blackops.ca/cms/blog/
    PorthosUser is Offline
    New Member
    New Member
    Posts:2
    Avatar

    --
    23 Jan 2012 10:24 AM
    Thanks but I couldnt use that, I would be running this script for auditing purposes and need the results to be based off of the group instead of a user
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Many thanks to our original sponsors: Quest Software • SAPIEN Technologies • Compellent • Microsoft footer
    footer   footer