Grant a single user access to access all users calendars in Office 365

Source: https://www.tachytelic.net/2014/06/grant-single-user-permissions-access-users-calenders-office-365/

If you need to Grant a single user access to access all users calendars in Office 365 this can be achieved by using the Add-MailboxFolderPermission cmdlet.

If you are adding permissions to a mailbox where no access rights exist already then this is straightforward, but if there is already some access rights in place then the command will fail, because there is an existing permissions entry in place.

You can check for the presence of existing folder permissions with the use of Get-MailboxFolderPermission cmdlet.

Finally if you find there is any existing permission in place you can remove it by using the Remove-MailboxFolderPermission cmdlet.

PowerShell script to Grant a single user access to access all users calendars in Office 365

The various levels of permissions are as follows:

  • None – Has no access to the folder.
  • Owner – Gives full control of the folder. An Owner can create, modify, delete, and read folder items; create subfolders; and change permissions on the folder.
  • Publishing Editor – Has all rights granted to an Owner, except the right to change permissions. A Publishing Editor can create, modify, delete, and read folder items and create sub folders.
  • Editor – Has all rights granted to a Publishing Editor, except the right to create subfolders. An Editor can create, modify, delete, and read folder items.
  • Publishing Author – Can create and read folder items and create subfolders but can modify and delete only folder items that he or she creates, not items created by other users.
  • Author – Has all rights granted to a Publishing Author but cannot create subfolders. An Author can create and read folder items and modify and delete items that he or she creates.
  • Nonediting Author – Can create and read folder items but cannot modify or delete any items, including those that he or she creates.
  • Reviewer – Can read folder items but nothing else.
  • Contributor – Can create only folder items and cannot read items.
  • Availability Only – View only availability data
  • Limited Details – View availability data with subject and location
$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection

Import-PSSession $Session
$userToAdd = "[email protected]"
$users = Get-Mailbox | Select -ExpandProperty PrimarySmtpAddress
Foreach ($u in $users)
{
$ExistingPermission = Get-MailboxFolderPermission -Identity $u":\calendar" -User $userToAdd -EA SilentlyContinue
if ($ExistingPermission) {Remove-MailboxFolderPermission -Identity $u":\calendar" -User $userToAdd -Confirm:$False}
if ($u -ne $userToAdd) {Add-MailboxFolderPermission $u":\Calendar" -user $userToAdd -accessrights Editor}
}

Remove-PSSession $Session
Close Menu