I am trying to create a script that will export the members of 6 AD security groups. I need to include properties such as the users sAMAccountName, Department, Title, and Managers “Display Name”.
The twist for me is that I need to export all of these groups into one Excel sheet or CSV if Excel is to much trouble, then email out the report. But also, the other issue I have is that I have no idea how to list the group name that the report is generated for in a column so that it would be something like:
Group1 sAMAccountName Department Title Manager
The Group1 name is the name of the group that these users are a member of, but I don’t want the names of “all groups” the users might be a member of.
Can anyone help me with this as I’m stuck essentially from the start to end