Thanks for reaching out to Microsoft!
The "Access to OData is disabled." message indicates that an application access policy is configured, restricting API access to the mailbox. To resolve this issue, you should check the EWS (Exchange Web Services) setting.
Firstly, run the below PowerShell code to connect to the office 365 tenant.
$Pwd = ConvertTo-SecureString –String $Password –AsPlainText -Force
$userCredential = New-Object –TypeName "System.Management.Automation.PSCredential" –ArgumentList $Account,$Pwd
$O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $userCredential -Authentication Basic –AllowRedirection
Import-PSSession $O365Session –AllowClobber -DisableNameChecking
Follow here: How to Fix "Access to OData is disabled" when Calling Graph API
Hope this helps!
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.