I am working with the Set-Distributiongroup -AcceptMessagesOnlyFromSendersOrMembers attribute. This is a multi-value property but when I use a csv file input with multiple values(separated by a comma), powershell appears to see it as a single value and can’t find it.
$group = import-csv c:\temp\restrictedgroups.csv
foreach($i in $groups)
$name = $i.group
$senders = $i.senders
set-distributiongroup $name -AcceptMessagesOnlyFromSendersOrMembers $senders
Echoed on screen
#Restricted Senders-City, #Restricted Senders ($senders)
The returned error:
Couldn’t find object “#Restricted Senders-City, #Restricted Senders”. Please make sure that it was spelled correctly or specify a different object.
It is not the spaces in the name of the group. If I put a single entry into the Senders column, such as #Restricted Senders, it works correctly. It only errors when there are multiple values in that column.
Any help would be appreciated.