“An error occurred while executing the function” error appears when connected to workstation operating under Windows Server 2012 R2 from workstation under Windows 10 and attempted to issue a card. No error occurs when RDP is not used.
The error cause is that Indeed CM cannot log in to device if the latter is forwarded via RDP. The error might be attributed to KB2992611 and KB3000850 updates for Windows Server 2012 R2.
Remove KB2992611 and KB3000850, if these are installed. If the problem persists, then edit the registry of Windows Server 2012 R2 and set the ProtectionPolicy parameter to 1 in the following branch: HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Protect\Providers\df9d8cd0-1501-11d1-8c7a-00c04fc297eb and try to issue a smart card again.
The recommendation is based on Microsoft article: https://support.microsoft.com/en-us/help/3000850/november-2014-update-rollup-for-windows-rt-8-1-windows-8-1-and-windows