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 share...
David Stone
Sep 27, 2018Copper 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