Forum Discussion
Edward Lee
Apr 06, 2017Iron Contributor
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 StoneCopper 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 CALENDARclsSet-ExecutionPolicy RemoteSigned -Scope CurrentUser$UserCredential = Get-Credential$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirectionImport-PSSession $SessionWrite-Output "======================================================="Write-host "============= Setting Calendar Permission =============" -foreground "yellow"Write-Output "======================================================="$useAccess = Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Select IdentityclsWrite-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 $accRightSet-MailboxFolderPermission "$($_.SamAccountName):\calendar" -User $user.Identity -AccessRights $accRight}}}clsWrite-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- RalphHaneyCopper ContributorHey David,
Did you run this in your instance? Any fallout? Thnx.- David_Stone2100Copper 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 LeeIron 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!
- HI Edward
Try to share each user into the group with the Powershell command
(cmdlet Set-MailboxFolderPermission )