I had a case with one of our customers today, users could not logon to the terminal server any more (2008 R2). And those who where logged in got a temporary profile. This is very common problem if you look for this on TechNet for example. Event ID 1508 or Event ID 1502. Restarting the server will work for few hours then this problem started again. But most of the solution we read on technet did not match (giving new local profiles, edit .bak in registry ProfileList for example). That is the reason for this article :) My first article, but not the last one!

Picture if the error shown below:
The User Profile Service service failed the logon. User profile cannot be loaded:


Windows was unable to load the registry. This problem is often caused by insufficient memory or insufficient security rights.

DETAIL - Insufficient system resources exist to complete the requested service.

for C:\Users\username\ntuser.dat

This error was thrown in the eventviwer and I looked at the default user registry hive, which is default located here: C:\Windows\System32\config - filename is DEFAULT and noticed that it was 2GB!
Then after more investigation we saw that old/corrupt printer drivers where bloating our default user registry. (Xerox 3320).
We exported this key: HKEY_CURRENT_USER\Printers\DevModes2 - and yes, it was around 2GB.
The solution is to recreate the default user registry - and of course update/reinstall the printer driver to prevent this in the future.

To be able to access / change default user hive - you have to boot from windows 2008 R2 iso/usb/cd - then on the install screen you choose repair your computer, select "use recovery tools" next and then you select Command Prompt. In our case D:\ was our "C:\" drive.

So next is just to go to d:\Windows\System32\Config and rename the current default registry file (ren default default.old) and then restart the server. A new default registry will be created automatically (and will be 256kb to start with). 
This solved the problem today and now we have happy terminal server users again! :-)