Hi Gabe, Does this make any changes for you?
$Username = Read-Host "Please Enter your Username"
$Grouplist = Get-AzureADUser -ObjectID $Username | Get-AzureADUserMembership | ForEach-Object {
Get-AzureADObjectByObjectId -ObjectId $_.ObjectId | Select-Object DisplayName, ObjectType, MailEnabled, SecurityEnabled, ObjectId
}
$Grouplist | Export-CSV -Path "C:\users\GBU101\Groupinfo_$Username.csv" -NoTypeInformation -Append -Delimiter ";"
It works for me - have done some small changes but can for sure be optimized :)