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
RalphHaney
May 06, 2021Copper Contributor
Hey David,
Did you run this in your instance? Any fallout? Thnx.
Did you run this in your instance? Any fallout? Thnx.
- David_Stone2100May 10, 2021Copper 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.
- RalphHaneyMay 10, 2021Copper Contributor
David_Stone2100 Thanks for the blast-from-the-past followup. I don't like it when I'm asked to override default privacy permissions on a platform, but it is what it is. I do want to stay employed. 🙂 Appreciate your time.