Check if in the event viewer (under Start/Programs/Administrative Tools/Event Viewer) under Application Log you have "UserEnv" errors with a description of: "Windows cannot unload your registry file. If you have a roaming profile, your settings are not replicated. Contact your administrator."
If so the problem is caused by Windows not being able to unload a part of the registry hive that contains your registry settings. If it's unable to unload it the first time it will try again for 60 seconds at a rate of once every second. This can happen when a program opens a registry key but doesn't release it nicely when it's shut down.
There are a few solutions and also a couple of work arounds you can try. First of all if you don't have SP3 installed yet go download and install it and see if that fixes the problem. Just choose to "log off" instead of "shut down"/"restart". It will keep the waits to a minimum.
(Don't get too happy if at one point it'll log off instantly because I had that happen too but try it at least three times to be sure).
If you already had SP3 installed or it didn't work check the Add/Remove programs window and see if you have any Pre-SP4 hotfixes installed, specifically look for hotfixes Q328310 and Q329170. Uninstall Q328310 first if it's there and reboot, then uninstall Q329170 and reboot. Now try logging off again and see if it's fixed (this worked for me). You can apply hotfix Q328310 again if you need it (the WM_TIMER causes etc etc) and Q329170 as well (in that order) but on one machine it worked but on the other right after reinstalling Q329170 it "hung" on log off again.
If none of the above worked then try disabling the printer spooler service before logging off (open a command prompt and type:
net stop spooler). For a lot of people this made it stop "hanging". If you don't have a printer attached to that computer you can set the service to disabled to prevent it from starting (Control Panel/Administative Tools/Services.. right click the Print Spooler and set it to Disabled).
If you do have a printer you can make a logon/logoff script that will start/stop the service each time you log on/off if you know how to do that, that's the first workaround.
Otherwise Start/Run and then: gpedit.msc to access the Group Policy Editor. Go to Computer Configuration/System/Logon/Maximum retries to unload and update user profile. You can look at the explain tab to see what it's used for. Basically it tells Windows how many times it should retry unloading your part of the registry hive. (One try is one second). Set it to Enable and then 5 tries. Press OK and then close the group policy editor and reboot. I'm not sure if the change happens instantly or not but it should be alright after the next reboot.
One of the things I said should work hopefully.. best of luck
