I received this little error message today when checking my Tenant Attach features.
Details: Unexpected error occurred.
Micrsoft has a troubleshooting guide for Tenant Attach https://docs.microsoft.com/en-us/mem/configmgr/tenant-attach/troubleshoot-client-details#bkmk_1603 and I followed the advice from that to no avail. The CMGatewayNotificationWorker, AdminService and SMS_REST_PROVIDER logs from the site server all looked fine.
Thankfully Anton, from the ConfigMgr product group, pointed me to a permission problem and sure enough the account which I was logged into the Endpoint Manager console with had zero permissions in ConfigMgr.
If you follow the guidance, and I even blogged about it – https://sccmentor.com/2020/06/19/tenant-attach-extras-4-timeline/ for example, then you need to set the correct permissions for that Tenant Attach feature.
So that blog; ‘The following permissions are required for this cool feature to operate:
- Read permissions on the device’s collection in ConfigMgr
- Read Resource permission under Collection in ConfigMgr’
Make sure you check the permissioning required for each particular Tenant Attach feature and set it accordingly as they vary.
At present the error ‘Unexpected error has occcurred’ doesn’t really match the problem, but Anton did mention that Microsoft is going to issue some improved messaging about this specific problem in the near future.
In the meantime, I hope this helps you out.
*** Update 16.06.2022 ***
Note that you get an error code 404 for this problem also. Not sure if this is an addition since the original posting of the article.