One of the last resort in fixing a user issue on a terminal server environment is to delete user profiels in order to start with a clean slate. That proved to be very difficult for me than I anticipated in a Terminal Server 2008 environment. I used server 2003 beforeand it was not as pain as this. Server 2003 all you had to do is just delete the user profile and ask the user to log back in. With that mind set here goes the story. 

 It is very easy to think a local user profile on Windows Server 2008, Windows Vista and Windows 7 directory is located under C:\Users directory(if you are using your Server 2003 knowledge). Behind the scene technicality is a bit different. Windows Server 2008, Windows Vista, Windows 7, contrary to common belief, actully keeps track of all the profiles that gets created in the registry key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.” Each of the profiles that is stored lcoally (happens in terminal server 2008 environment as well) a subkey is created.  If you are not sure which profile you are looking for you should be able to see the username of each profile when you click on each SID. 

What I did that caused the headache? 

What happens if you delete the user profile directory below C:\Users\”Username” without modifying the registry? Well that is exactly what caused the headch for me. After deleting the profile, when the user logged in Windows displays a balloon tip (see the figure 1) indicating that Windows could not load the user profile and that the user was logged on with a temporary profile. As you know, temporary profile is the last option available to Windows to log you in if it can not load your profile properly. After you log off, all the changes are lost. 

Figure: Event ID 1511

So how do you really delete a profile? 

Follow  one or the other options below: 

  1. Well make sure you delete the profile directory AND the subkey from the rigstry.
  2.  Go to start > run and type in sysdm.cpl. From there go to Advanced Tab, then to Settings on User Profiles and delete the profile you want to delete from there.

Figure: User Settings

 Too late, I already deleted the profile, now what? 

Not to worry. Windows is really smart (!). If windows finds an orphan ProfileList subkey matching a userprofile’s SID without an associated profile directory (C:\Users\”username”) it backs up the ProfileList subkey with a.bak extention. Just remove the one that corresponds to your troubled profile. 

This was also the reason why if you don’t delete this none of the trobuelshooting will show up because the balloon tip needs to go first. Only way it will go is by deleting .bak subkey. 

This does not apply to any machines with Server 2003 because it uses simplistic approach. If a ProfileList registry exists but directory does not, it just recreates the new profile and overrides the data. 

Anyways, as much as I like windows server 2008, at the same time I have to wonder why Microsoft made this change! Maybe because they thought some users will find temporary profile very useful?

Comments

One Response to “Deleting a local user profile on Terminal Server 2008 – Very tricky and a bit complicated than deleting it from Server 2003”

  1. Keith lancaster on January 12th, 2012 12:45 pm

    Many thanks. Just the info I needed.

Leave a Reply