Powershell script to grant delegate permission to O365 Calendar 

Set-ExecutionPolicy RemoteSigned
Function Connect-EXOnline {

$URL = “https://ps.outlook.com/powershell”

$Credentials = Get-Credential -Message “Enter your Office 365 admin credentials”

$EXOSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $URL -Credential $Credentials -Authentication Basic -AllowRedirection -Name “Exchange Online”

Import-PSSession $EXOSession

}

Function Disconnect-EXOnline {

Remove-PSSession -Name “Exchange Online”

}
Set-ExecutionPolicy RemoteSigned

Connect-EXOnline;
cls
$allUsers = Get-Mailbox | Select Identity

Write-Host “Now Start ….”
Write-Host $allUsers
ForEach ( $user in $allUsers ) {

$user.Identity
$mailbox = Get-Mailbox -Identity $user.Identity

$SIPAddress = $mailbox.WindowsEmailAddress
$SIPAddress
#If ( $_.Identity -ne $user.Identity ) {
$var = $SIPAddress +”:\calendar”

$var
Add-MailboxFolderPermission -Identity $var -User saccount@abc.com -AccessRights PublishingEditor
Set-MailboxFolderPermission -Identity $var –User saccount@abc.com -AccessRights PublishingEditor

}