If your Windows Server 2003 terminal server uses an early version of the User Profile Hive Cleanup Service (UPHClean) utility to unload the user profile when a user logs off, your server may BSOD with any of the following STOP codes:

Stop 0x00000005
Stop 0x00000050
Stop 0x0000000A

This behavior can occur if the version of UPHCLEAN is earlier than version 1.5.

You can check the version from the Application event log entry:

Source: UPHClean
Event ID: 1001 Type: Information
Description: User profile hive cleanup service version 1.5.0.11 started successfully.

To resolve this problem, download and install the latest version of the User Profile Hive Cleanup Service (UPHClean) utility.