How to export group memberships of Active Directory users into CSV format..

So I started a new job recently, and I am working on a as-is migration. I needed to export the list of AD users and their group memberships into human readable format. So this is how I did it. $users = Get-ADUser -Filter * foreach ($user in $users) { $Groups = (Get-ADPrincipalGroupMembership -Identity $user.SamAccountName | […]