I've got the following script as part of a larger piece where param-members is an AD Object picker list seperated by a ' ; ' currently:
New-DistributionGroup -Name 'U_Mailbox - %param-company% %param-mailbox-name%' -Alias '%param-mailbox-name%.group' -DisplayName 'U_Mailbox - $company %param-mailbox-name%' -OrganizationalUnit '%param-company%' -PrimarySMTPAddress '%param-mailbox-name%.group@%param-domain' -members '%param-members%'
The problem is that param-members provides the DN of the User object and I either need that to be in "" or convert that to username but I'm struggling to achieve that with multiple Users selected