I use this
$groups =Get-ADPrincipalGroupMembership $user
$group = $groups.name
Send-MailMessage -To “firstname.lastname@example.org” -From “email@example.com” -Subject “List of groups $user is member off” -Body “ $group Best regards” -Credential $emailcred -SmtpServer “outbound.mydomain.com” -Port 25
this will give me the clean name without the “CN=” ect
now I want to send this by mail to a common mailbox but I do get it printed out like groupA groupB groupC
by preference I would like to print this
how do I achieve this?