header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Query AD Groups and Export Users to CSV - Quest ActiveRoles AD Management
Last Post 26 Aug 2010 02:33 PM by Daniel Son. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Daniel SonUser is Offline
New Member
New Member
Posts:44
Avatar

--
26 Aug 2010 10:28 AM
    Trying to return a set of CSV files based on group members in Active Directory.  Unfortunately this command doesn't look at the groups within the group. ie. HW (Global Security) contains groups like Denver_HW, and Aurora_HW.  But the command I am using is not returning the nested groups' members.

    I have about 200 groups to go through, and I am satisfied with the results from the following command:

    get-qaduser -memberof  GroupName | select firstname, lastname, description, samaccountname, userprincipalname | export-csv c:\groupname.csv

    Option 1.
    I want to query AD for all groups, enumerate members in the group and export results to a file called c:\groupname.csv

    From there I will manually cut and paste members from Aurora_HW and Denver_HW into the main HW csv. 

    Option 2 (preferred)
    Enumerate all members within the top level groups to include members of nested group and export those results to .csv

    So if I enumerate HW, it will automatically get everyone from HW, Aurora_HW, and Denver_HW and export it to a file called HW.csv

    Then if I enumerate SA it will automatically get everyone from SA, Aurora_SA, and Denver_SA and export it to a file called SA.csv
    Twitter @danielson1
    Daniel SonUser is Offline
    New Member
    New Member
    Posts:44
    Avatar

    --
    26 Aug 2010 02:33 PM
    Okay - maybe this was a little vague?

    I am trying this:

    gc .\groups.txt | % {
    $group = $_
    get-qaduser -memberof $group | % {
    export-csv -path "C:\scripts\usergroups\$group.csv"
     }
    }

    Twitter @danielson1
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer