Hi there,
This is a known issue and there are several users who have faced a similar issue. Below is some workaround that has helped them.
Check below registry key and make sure that the key “Value date” is Windows Server 2016 Essentials’ FQDN (system – full computer name):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Server\ADContext
Below threads discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.
Windows Server 2016 Essentials Dashboard can't integrate with Office 365 https://learn.microsoft.com/en-us/answers/questions/342869/windows-server-2016-essentials-dasboard-can39t-int.html
Office 365 Integration fails with "Cannot connect to Microsoft online services" in Windows Server 2012 R2 Essentials https://learn.microsoft.com/en-us/archive/blogs/sbs/office-365-integration-fails-with-cannot-connect-to-microsoft-online-services-in-windows-server-2012-r2-essentials
---------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–