I am trying to disable "Email Apps" features on Azure admin center for an off-boarding script. I'm not sure if I can pass a few parameters into a foreach loop, below is the code. I've ran the code with param defined and without param defined.
param(
[parameter]$DisableApps
)
$DisableApps = ("OWAEnabled" , "EwsEnabled" , "PopEnabled")
foreach ($i in $DisableApps){Set-CASMailbox "Sahand.Test" $i $false}
The error I am getting is -
A positional parameter cannot be found that accepts argument '-OWAEnabled'. + CategoryInfo : InvalidArgument: (:) [Set-CASMailbox], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Set-CASMailbox + PSComputerName : outlook.office365.com
Set-CASMailboxhas an enormous amount of parameters. Make sure you're naming them.