Hi,
I am trying to add calendar permissions for multiple users with this command:
Get-mailbox -Filter {(CustomAttribute1 -eq "manager")} | Select-Object alias | ForEach-Object {Add-MailboxFolderPermission $_.alias:\Calendar -User someuser -AccessRights Editor}
I get error:
A positional parameter cannot be found that accepts argument ':\Calendar'
But when I run:
Get-mailbox -Filter {(CustomAttribute1 -eq "manager")} | Select-Object alias
It all works fine, I get i list of aliases with C.Attr1 "manager".
What is wrong with my piped ForEached-Object???