Configure Calendar Synchronization for Microsoft Exchange in Office365 using OAuth2 Authentication
Make sure that you have Administrator access rights and can access the Azure Active Directory admin centre.
Configure a Monitor User
- Verify that you have a public DNS record pointing to the Exchange server from the Internet, for example by resolving
yourdomain.com. - Ensure the enterprise firewall allows inbound HTTPS (TCP port 443) connections from all Service Nodes to the Exchange servers.
-
Access Windows PowerShell of the Exchange Server and prepare the password string using:
$Password = "yourPassword" | ConvertTo-SecureString -AsPlainText -Force -
Create a new monitor user and enable its mailbox:
New-Mailbox -Name "Monitor" -Alias "Monitor" ` -OrganizationalUnit 'domain/Users' ` -UserPrincipalName monitor@yourdomain.com ` -SamAccountName "monitor" ` -FirstName "yourFirstName" ` -LastName "Monitor" ` -Password $Password ` -ResetPasswordOnNextLogon $false ` -Database "yourStorageGroup\yourDatabase"Use
Enable-Mailboxinstead if you're enabling an existing user. -
Grant FullAccess rights to the Monitor user:
Get-Mailbox -ResultSize Unlimited | Add-MailboxPermission -User "Monitor" -AccessRights FullAccess -InheritanceType All
Grant Calendar Rights per User
Use a script to apply calendar folder rights in batch, especially helpful when managing multiple users.
-
Retrieve the Monitor user:
$User = Get-Mailbox Monitor -
Get all mailboxes:
$Mailboxes = Get-Mailbox -ResultSize Unlimited -
Set calendar permissions for each mailbox:
$Mailboxes | ForEach-Object { Add-MailboxFolderPermission $_":\Calendar" -User $User.Identity -AccessRights Reviewer }Note: "Calendar" folder name may vary depending on the Exchange language settings.
Set Up OAuth2 Access in Azure
- Sign in to https://portal.azure.com
- Navigate to Azure Active Directory → App registrations.
- Click New registration, name it (e.g., "Exchange calendar synchronization"), then click Register.
- Save the Application (client) ID and Directory (tenant) ID.
- Under Certificates & secrets, click New client secret, name it, and choose an expiry time.
- Copy the Client Secret Value and store it safely. You will use this, together with the Application ID and Tenant ID, in the calendar connector configuration.
- Go to API permissions → Add a permission → Microsoft Graph.
- Select Application permissions → Calendars.Read.
- Click Grant admin consent for [your company].
- Follow the prompts in the pop-up window.
- Wait until the status shows green in the Configured Permissions window.
Relaterad till
Uppdaterad