Convert array to string for output

Hi,
I’m working on an export script to list permissions on mailboxes, and I exported the group members with permissions to an array.

$members = Get-ADGroupMember $groupcontent | select name
I would now like to show them on-screen, and seperated by a “;”

I execute the following :
write-host $mailbox.PrimarySmtpAddress ’ ; ’ $members

But the output is shown as :

Mailboxname@domain.edu ; @{name=User001} @{name=User002}

I however would like to show it as
Mailboxname@domain.edu;User001;User002

Can someone help me to get this?
When I try to use this to change the array to a string, I don’t get the expected result
$members | Join-String -DoubleQuote -Separator ‘,’

DGS,
Welcome to the forum. :wave:t4:

Could you please show the rest of your code? Where do you define the variable $Mailbox?

Turning objects and properties we use in PowerShell to strings usually will not make it any better. What do you want to do with the information shown to the console?

and BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <---- Click :point_up_2:t4: :wink: