Most companies have policies which permit all users to share their calendars with everyone. There are several PowerShell scripts available online to configure this. However the tricky thing is most enterprises have different Outlook client languages. Because the Outlook client language determines the mailboxfolder attribute to it’s unique language. In this case it is set to the Dutch version “kalender” and the Engilsh version “calendar”.
- The fist thing which needs to be done is creating a mail-enabled universal securitygroup on-premises which contains all user objects. Make sure it syncs to Office365 with Windows Azure DirSync.
- Once the objects have been succesfully synchronized to the cloud run the script below to determine which language the calendar mailbox folder is:
$GroupMembers = Get-DistributionGroupMember SG_CalendarReviewer
$GroupMembers | foreach {
try
{
$isNL = ((Get-MailboxRegionalConfiguration -Identity $_.PrimarySmtpAddress | where {$_.Language -eq “nl-NL”} | Measure).Count -eq 1)
if ($isNL)
{
$identity = $_.PrimarySmtpAddress + “:\Kalender”
}
else
{
$identity = $_.PrimarySmtpAddress + “:\Calendar”
}$permission = Get-MailboxFolderPermission -Identity $identity -ErrorAction SilentlyContinue | where {$_.User.toString() -eq “SG_CalendarReviewer”}
if ($permission)
{
write-host “$identity has permission”
}
else
{
write-warning “$identity doest not have permission”
} }
catch
{}
} - Once you have determined which language the mailboxfolder is for the calendar run this PowerShell script to grant all users in the created securitygroup with the ” Reviewer” on every mailbox belonging to each user object in the securitygroup. The PowerShell script listed below grants the access-right to all English calendars:
$GroupMembers = Get-DistributionGroupMember SG_CalendarReviewer
$GroupMembers | foreach {
$identity = $_.PrimarySmtpAddress + “:\calendar”
$permissionExists = ((Get-MailboxFolderPermission -Identity john.doe@domain.com:\calendar | where {$_.User.toString() -eq “SG_CalendarReviewer”} | measure).Count -eq 0)
#Add-MailboxFolderPermission -Identity -User SG_CalendarReviewer -AccessRights Reviewer
} - Now change the mailboxfolderpermission attribute to the appropiate language and run the last script again.