Exception A parameter cannot be found that matche
2 min
Issue
Create Distribution List task fails with this error: Exception: A parameter cannot be found that matches parameter name 'HiddenFromAddressListsEnabled'. When trying to create a DL hidden from the address list in Exchange Online.
Solution
The Distribution Lists script runs this cmdlet against EXO to hide the new DL from address lists:
exchange.Exec("Set-DistributionGroup", "Identity", mail, "HiddenFromAddressListsEnabled", true);If you are getting the error above it means the account that is executing the cmdlet does not have rights to use that parameter.
I solved the issue by granting Exchange Administrator rights to the account configured on Resources > Configuration > Office365 > Credentials.
There is probably a more granular option, but I was unable to find any Microsoft documentation on this.