Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance forum
Viewing all articles
Browse latest Browse all 9032

Whats wrong with this command? (PS Add-MailboxFolderPermission...)

$
0
0

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???


Viewing all articles
Browse latest Browse all 9032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>