Hello ToniMartikainen-1813,
Thank you for reaching out.
Looking at your error, it seems like the issue is related to the EwsApplicationAccessPolicy. Please run "Get-OrganizationConfig | select EwsApplicationAccessPolicy, EwsAllowList, EwsBlockList"
See if EwsApplicationAccessPolicy is set to EnforceAllowList which means only the applications (user agent strings) configured in EwsAllowList are able to access EWS. If EwsAllowList is empty, that means there is no application which is allowed to access EWS.
Please go through this article for further details;- https://learn.microsoft.com/en-us/archive/blogs/wushuai/how-to-fix-access-to-odata-is-disabled-when-calling-graph-api
Please also check whether a user-specific policy has been applied;- Get-CASMailbox <user-principal-name> | fl EwsApplicationAccessPolicy,EWS*List
Hope that helps.
Thanks
--please don't forget to upvote
and Accept as answer
if the reply is helpful--