# Delegate to many Mailboxes

I have a user that has been made the delegate of many shared Calendars and would like to be removed as such. Is there a PS that would identify the mailboxes the user is a delegate of, and remove her?

thank you!!
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Try something like this (replace user@domain.com on the last line):

$calendars = Get-Mailbox -RecipientTypeDetails UserMailbox | Get-MailboxFolderStatistics | ? {$_.FolderType -eq "Calendar"} | select @{n="Identity"; e={$_.Identity.Replace("\",":\")}}$calendars | % {Remove-MailboxFolderPermission -Identity \$_.Identity -User user@domain.com }

0
Commented:
Oh, it will give you errors for mailboxes on which she's not a delegate, but nothing bad will happen. If you want to get rid of the errors, just put a simple if check (though it will make the execution twice as slow!).
0
Author Commented:
Vasil,

The person still needs full access to the Calendar. She just needs to be removed as a delegate to avoid receiving constant Calendar reminders
0
Commented:
Oh, I see, that delegate option. You cannot control that with the built-in PowerShell cmdlets. You either have to use Outlook to disable it, or to use some EWS based script as for example: http://www.flobee.net/delegate-management-module-updated-to-v1-4-5/
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Active Directory/Exchange EngineerCommented:
Kt,
Put all the users she has access to in a list and name it as users .csv file  then the file in your temp directory or wherever you want then run the below command

import-Csv c:\temp\users.csv | foreach-object {set-mailboxfolderpermission -Identity usernameofthedelegate:\calendar -AccessRights Reviewer}

change the command to wherever your csv is and after -AccessRights give the level she needs

http://digipulse.nl/2011/01/14/calendar-access-rights-exchange-2010-sp1/
0
Author Commented:

Thanks both.
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.