Monthly Archives: April 2014

Editing calendar permissions Office 365 with powershell

After adding a new user into Office 365, the user has to be allowed to read/write some shared calendars withing the organization.

First of all you will need to connect to Office 365

Add permission to the calendar

[codesyntax lang="powershell"]

Add-MailboxFolderPermission calendar@company.com:\Calendar -User dude@company.com -AccessRights Author

[/codesyntax]

Note: AccessRights can be: Owner, PublishingEditor, Editor, PublishingAuthor, Author, NonEditingAuthor, Reviewer, Contributor, AvailabilityOnly, LimitedDetails

Get permission for a specific users

[codesyntax lang="powershell"]

Get-MailboxFolderPermission -Identity calendar@company.com:\Calendar -User dude@company.com

[/codesyntax]

To remove permissions for a specific user:

[codesyntax lang="powershell"]

Remove-MailboxFolderPermission -Identity calendar@company:\calendar -user dude@company.com

[/codesyntax]

 

UPDATE:

What if you need to change the calendar permissions for all users within your organization?!

[codesyntax lang="powershell"]

$allmailbox = Get-Mailbox -Resultsize Unlimited

Foreach ($Mailbox in $allmailbox)
{
    $path = $Mailbox.alias + ":\" + (Get-MailboxFolderStatistics $Mailbox.alias | Where-Object { $_.Foldertype -eq "Calendar" } | Select-Object -First 1).Name
    Set-mailboxfolderpermission –identity ($path) –user Default –Accessrights AvailabilityOnly
}

[/codesyntax]