Link to home
Start Free TrialLog in
Avatar of Christian Hans
Christian HansFlag for United States of America

asked on

Bulk Remove Calendar Permissions

What am I doing wrong?

I am trying to bulk remove all the users that have access to a some resource room calendars...

$Users = Get-MailboxFolderPermission -Identity "roomresource1@contoso.com:\calendar"
foreach ($User in $Users)
{
Remove-MailboxFolderPermission -Identity "roomresource1@contoso.com:\calendar" -User $user
}

Open in new window


I can then go back and add the Default and Anonymous settings:

Add-MailboxFolderPermission "roomresource1@contoso.com:\calendar" -User "Default" -AccessRights Reviewer
Add-MailboxFolderPermission "roomresource1@contoso.com:\calendar" -User "Anonymous" -AccessRights None


Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of FOX
FOX
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Christian Hans

ASKER

Thank you Fox.

So close... now I get the following:

Cannot process argument transformation on parameter 'User'. Cannot convert the "jeff.smith@contoso.com" value of type "Deserialized.Microsoft.Exchange.Management.StoreTasks.MailboxFolderUserId" to type
"Microsoft.Exchange.Management.StoreTasks.MailboxFolderUserIdParameter".