Forum Discussion

Edward Lee's avatar
Edward Lee
Iron Contributor
Apr 06, 2017

How can I make all users calendar shared with all other users?

How can I make the calendar for all users in a particular group shared with all other users in that group? And, any time I add a new user to the all staff group, their calendar is automatically shared?

 

Thank you!

  • David Stone's avatar
    David Stone
    Copper Contributor

    I have been all over the Internet looking for something that works. Finally contacted Microsoft support and they provided me with this, which works perfectly.

     

    If in Windows 10, Powershell ISE will be pre-installed. Otherwise you need to install this. 

    Run as administrator to open

    Run this script. It will ask you to login to your Office 365 administrator account and which level of common access you want to provide (we went for reviewer). 

     

    #GIVE ALL USERs ACCESS TO ALL CALENDAR
    cls
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    $UserCredential = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
    Import-PSSession $Session
    Write-Output "======================================================="
    Write-host "============= Setting Calendar Permission =============" -foreground "yellow"
    Write-Output "======================================================="
    $useAccess = Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Select Identity
    cls
    Write-Host "AccessRights: None, Owner, PublishingEditor, Editor, PublishingAuthor, Author, NonEditingAuthor, Reviewer, Contributor" -foreground "yellow"
    Write-Host "This script will attempt to modify and add a user permission. You may have an error message if the user is already added. Please ignore." -foreground "darkcyan"
    Write-Host "---------------------" -foreground "gray"
    $accRight=read-host "Please enter the desired access right for all users. Ex: Reviewer"
    ForEach ( $user in $useAccess ) {
    Get-Mailbox -ResultSize Unlimited | ForEach {
    If ( $_.Identity -ne $user.Identity ) {
    Add-MailboxFolderPermission "$($_.SamAccountName):\calendar" -User $user.Identity -AccessRights $accRight
    Set-MailboxFolderPermission "$($_.SamAccountName):\calendar" -User $user.Identity -AccessRights $accRight
    }
    }
    }
    cls
    Write-Output "======================================================="
    Write-host "============ CALENDAR INFORMATION UPDATED =============" -foreground "green"
    Write-Output "======================================================="
    ForEach ($mbx in Get-Mailbox -ResultSize Unlimited) {Get-MailboxFolderPermission ($mbx.Name + “:\Calendar”) | Select Identity,User,AccessRights | ft -Wrap -AutoSize}
     
    Good luck
     
     
    • RalphHaney's avatar
      RalphHaney
      Copper Contributor
      Hey David,
      Did you run this in your instance? Any fallout? Thnx.
      • David_Stone2100's avatar
        David_Stone2100
        Copper Contributor

        RalphHaney Its a long time since I ran this code, but it worked fine at the time. As I mentioned in the original post, it was a common problem and the MS support team were really committed to creating a solution. The company has shrunk since then, so all diary access has become less of an issue. 

  • Hi Edward , Create a new distribution group, add all members to enter, open the Outlook calendar permissions to add a newly created distribution group, set the privilege level!
    • Edward Lee's avatar
      Edward Lee
      Iron Contributor

      But how can i do this for all useres without each person having to set their own permissions indiviually.

       

      In other words, i have a group called All Staff. Now, I want to set every member of that group to have reviewer permission on every other users calendar.

       

      Thanks Dongjie!

      • Dongjie's avatar
        Dongjie
        MVP
        HI Edward
        Try to share each user into the group with the Powershell command
        (cmdlet Set-MailboxFolderPermission )

Resources