Combining get-adgroupmember with get-aduser

Hi all,

I need a power shell script which does export into a CSV all members of 2 AD groups (call it group1 and group2) for which I get in the export several user properties in different columns (like Group name, E-Mail Address, UPN, Company, Department, Employee Type and some more).

I found all god tricks to export 2 groups but only for AD group name and user name (but missing all the other user properties).

But nothing that combines to have the Group name and other detailed user properties.

Can someone help me with this.

Best regards,