Set the group policy so that Windows 2012R2 does not forcefully unload the registry.
About this task
A new User Profile Service functionality built into the OS by default forces the unload of the user profile on Windows 2012R2 when the user logs off. This results in, for instance, a COM+ application to stop working on Windows Server 2012R2 when the identity user logs off and the COM+ application can no longer read registry keys in the profile of the identity user. The policy setting
Do not forcefully unload the user registry at user logoff counters the default behavior of Windows 2012R2. When enabled, Windows 2012R2 does not forcefully unload the registry and waits until no other processes are using the user registry before it unloads it.