Export Active Directory Security group with Department Name to CSV File

Anonymous
2020-07-15T05:05:04.363+00:00

Dears,
I have active directory security group name "XXX" it has almost 300 user accounts. I need to export all the users to CSV file and I need AD command to do this job and bring all the user accounts with their department names for each user and exported to excel file.
Best Regards,

Source link:
https://social.technet.microsoft.com/Forums/windowsserver/en-US/cc21451c-3afc-420a-9a15-9076b40cb40a/export-active-directory-security-group-with-department-name-to-csv-file?forum=winserverDS

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    2020-07-15T05:07:05.047+00:00

    Thank you so much for your kindly reply.

    You are welcome. So glad to hear that the link was very helpful to you. To export all required information to CSV file, we could try the below Powershell command.

    For example:
    Get-ADGroupMember -Identity "Engineering" -Recursive |
    Get-ADUser -Properties Title,Department |
    Select Name,Title,Department,SamAccountName,DistinguishedName |
    Export-CSV -Path c:\engineering.csv -NoTypeInformation
    12324-7152.png

    For more information, we could refer to:
    https://www.petri.com/powershell-problem-solver-exporting-active-directory-groups-csv

    Tip: This answer contains the content of a third-party website. Microsoft makes no representations about the content of these websites. We provide this content only for your convenience.

    If we have more question about this powershell command, we could turn to our dedicated PowerShell forum. Below is the forum link: https://social.technet.microsoft.com/Forums/en-US/home?forum=winserverpowershell.

    For any question, please feel free to contact us. Thanks again and have a nice day.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.