Link to home
Start Free TrialLog in
Avatar of David Sankovsky
David SankovskyFlag for Israel

asked on

Allowing a user access to all calendars in his OU

Hi Everyone.

I have a hosted exchange 2010 environment (Meaning we have many little companies that buy mailboxes from us, and each one has its own OU under the main OU called Hosting.Local)

One of our bigger clients has about 250 mailboxes in his OU, the CEO wants permission to view the calendars of all users in his OU.

I was wondering, is there a way to do it with a script to grant him this access or must I really do it manually for each mailbox?

For example, if the username for teh CEO is Hosting\CEO and the OU for said company is contoso, is it possible?

Hoping for a quick response.
Avatar of David Sankovsky
David Sankovsky
Flag of Israel image

ASKER

I've found this PS code

$allmailbox = Get-Mailbox -Resultsize Unlimited

Foreach ($Mailbox in $allmailbox)

{Set-mailboxfolderpermission –identity ($Mailbox.alias+':\calendar’) –user Default –Accessrights AvailabilityOnly}

Open in new window


But it will run on the entire exchange server which isn't good. how can I restrict it to a certain OU
I have modified your script above to point at a single OU. See below...
$allmailbox = Get-Mailbox -Resultsize Unlimited -OrganizationalUnit "OU=test,DC=hosting,DC=local"

Foreach ($Mailbox in $allmailbox)

{Set-mailboxfolderpermission –identity ($Mailbox.alias+':\calendar’) –user Default –Accessrights AvailabilityOnly}

Open in new window


Change the respective OU path with yours in your environment.

Will.
Hi Will. Thanks for your response.

I edited the script and it currently looks like this:

$allmailbox = Get-Mailbox -Resultsize Unlimited -OrganizationalUnit "OU=S001000415,OU=R0001000119,OU=HOSTING,DC=hosting,DC=local"

Foreach ($Mailbox in $allmailbox)

{Set-mailboxfolderpermission –identity ($Mailbox.alias+':\calendar’) –user yaron@sherut-leumi.co.il –Accessrights publishingeditor}

Open in new window


I now get several types of errors:

The specified mailbox "dana"  isn't unique.
    + CategoryInfo          : NotSpecified: (0:Int32) [Set-MailboxFolderPermission], ManagementObjectAmbiguousException
    + FullyQualifiedErrorId : A7E6CD60,Microsoft.Exchange.Management.StoreTasks.SetMailboxFolderPermission

Or

The operation couldn't be performed because 'debo:\calendar' couldn't be found.
    + CategoryInfo          : NotSpecified: (0:Int32) [Set-MailboxFolderPermission], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : 24C95A94,Microsoft.Exchange.Management.StoreTasks.SetMailboxFolderPermission

And the mailboxes that performaed the command succsfully only display available/busy on the CEO's account instead  of seeing all the details.
ASKER CERTIFIED SOLUTION
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada 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
Hi Will and thanks for the feedback - I did midify the script to work with addresses and it worked,
About the people who didn't have calendars, It simply took repeating the command with the Hebrew word for that - some of our mailboxes aren't configured in English.

Script works fine now. Thanks for all teh help :)