Sometimes a user profile on a server gets corrupted and the user has variety of the odd issues such as not properly mapped drives, only half of the installed printers work, etc. In order to load a clean copy of profiles the corrupted one should be deleted. However, sometimes the corrupted user profile folder is locked up and cannot be removed. Pretty often it happens when the user-related keys in registry have not been released. In this case you can try to unload these keys manually.
- Run ADSIEDIT.MSC and find the user account
- Right click on it and select Properties
- Find the oblectSid attribute, select it and click the Edit button
- This is how it usually looks like
- Take the last word and convert it into decimal representation. In this case it will be 54 AC 00 00.
- Switch the bytes (AC54) and get the value (44116) with the use of Windows calculator
- On the server run REGEDIT.EXE
- Go to the HKEY_USERS key and find the keys (usually two) started with S-1-5-21 and ended with -<decimal value> and -<decimal value>_Classes. In this case it will be -44116 and -44116_Classes
- Select the key, click File and click Unload Hive… for both keys
01 05 00 00 00 00 00 05 15 00 00 00 30 B6 82 B0 47 F4 C4 93 E6 C4 25 E4 54 AC 00 00
Not always does this method work, however, after that you can try to delete the profile folder again and try to log the user in again