Easy way to export group list from AD?

BokehBokeh Member Posts: 1,636 ■■■■■■■□□□
I have a sales manager who wants a list from two active email groups - sales and off premise sales. There's 50 or more in each group, and I need to get them in a csv file for him. Is there an easy way to export those on the email lists?

Comments

  • OctalDumpOctalDump Member Posts: 1,722
    2017 Goals - Something Cisco, Something Linux, Agile PM
  • NetworkNewbNetworkNewb Member Posts: 3,298 ■■■■■■■■■□
    assuming you'll need to use powershell, something like this to export users from a group.

    Get-ADGroupMember -identity “Name Of Your Group” -recursive | get-aduser -Properties mail |select name,samaccountname,mail |export-csv -path c:\groupmembers.csv -NoTypeInformation
  • knownheroknownhero Member Posts: 450
    assuming you'll need to use powershell, something like this to export users from a group.

    Get-ADGroupMember -identity “Name Of Your Group” -recursive | get-aduser -Properties mail |select name,samaccountname,mail |export-csv -path c:\groupmembers.csv -NoTypeInformation

    This is your best and quickest way. You could get really fancy and create a hashtable and do your get-adgroup for each Group you list. But you only have two groups so it would only be a learning exercise.
    70-410 [x] 70-411 [x] 70-462[x] 70-331[x] 70-332[x]
    MCSE - SharePoint 2013 :thumbup:

    Road map 2017: JavaScript and modern web development

  • getafix`getafix` Member Posts: 13 ■□□□□□□□□□
    assuming you'll need to use powershell, something like this to export users from a group.

    Get-ADGroupMember -identity “Name Of Your Group” -recursive | get-aduser -Properties mail |select name,samaccountname,mail |export-csv -path c:\groupmembers.csv -NoTypeInformation

    Sorry, a bit of a hijack, but is this the type of question you could expect in an exam?
  • poolmanjimpoolmanjim Member Posts: 285 ■■■□□□□□□□
    getafix` wrote: »
    Sorry, a bit of a hijack, but is this the type of question you could expect in an exam?

    Possibly but you would more likely see something more like.

    You run a Server 2012 forest with Server 2012 domain controllers. The Sales department needs a listing of all users assigned to the GSales group. How would you accomplish the task requiring the least administrative effort?

    A. Get-ADGroupMember
    B. Get-ADUser
    C. dsget group
    D. Export the Group Policy
    2019 Goals: Security+
    2020 Goals: 70-744, Azure
    Completed: MCSA 2012 (01/2016), MCSE: Cloud Platform and Infrastructure (07/2017), MCSA 2017 (09/2017)
    Future Goals: CISSP, CCENT
  • getafix`getafix` Member Posts: 13 ■□□□□□□□□□
    poolmanjim wrote: »
    Possibly but you would more likely see something more like.

    You run a Server 2012 forest with Server 2012 domain controllers. The Sales department needs a listing of all users assigned to the GSales group. How would you accomplish the task requiring the least administrative effort?

    A. Get-ADGroupMember
    B. Get-ADUser
    C. dsget group
    D. Export the Group Policy

    Gotcha - thanks
Sign In or Register to comment.