Systems Administration tech

Cleanly Removing a User Profile from Windows 7

One IT trick I learned a long time ago that seems to fix a lot of problems, especially with users who’ve been in a Windows system for years, is called “Rebuilding A Profile”. The most dramatic example of problems caused by a corrupted user profile that I’ve come across was from an old engineer at the power company. He was one of those guys who’d been with the power company since anyone could remember and had used the same user profile for over a decade at that point. It had become so corrupted that he would log in, then it would make him log in again. On top of that it made his computer run extremely slow and screwed up his Outlook functionality to the point he had to enter his password twice before it would connect to exchange.
It had gone on so long that he’d assumed it was because of his position and weird security settings he had. He’d been doing this for so long that he’d never bothered to report it to IT and only when I’d replaced his computer with a new one and noticed this issue did anyone take action. It took about 30 seconds to fix.
I’ve seen other less dramatic problems like this everywhere I’ve worked and the solution is usually the same. You delete the user’s current profile and then let them log back in and Windows will rebuild it.
CAUTION: This will pretty well wipe out any and all user customization, desktop backgrounds, Outlook data, practically everything. I really only suggest this for domained networks. If you have a network where every user is a local user name don’t attempt this or it WILL cause you some problems.
First thing you need to do is find where exactly the user profile is stored. You can do this by going into Active Directory Users and Computers, right clicking on the user and clicking on Properties. Under the profiles tab, you’ll see a Profile Path box. If it’s blank, that means it’s a ‘local profile’ and stored on their computer. If it’s got something like \\servername\profiles$\username that means it’s a roaming or server-side profile and that’s where it’s at. You’ll also want to take note of where their Home directory has been mapped to, again the same thing applies, if it’s blank it’s a normal local home folder, if it’s got a location mapped it’s in the place mentioned.
Once you’ve determined this follow these steps:

Step 1 – Log them out of Windows and log into a local administrator account.

Step 2 – Go into their Home Folder and make sure you back up their Desktop, Documents, and Favorites folders. You can just move these to a temporary directory. The default place for this is in “C:\Users\Username” . You’ll want to back up those basic folders on their local machine. If the home directory is on a network share, you’ll probably only see those folders that have been redirected there and typically the three I just mentioned are what get re-mapped to a network share. Go ahead and back those up. They might have other folders they’ve made here as well, you’ll want a copy of those too.

Step 3 – The next thing you want to do AFTER you’ve got a backup of their stuff is delete their profile folder on the local machine.  This will always be the C:\Users\Username folder mentioned in step one, whether that’s where their profile is located or not.

Step 4 – If they have a roaming or network profile go ahead and delete that profile folder too. If their home folder is separate you can just leave it in most cases.

Note: If when you complete these steps the problem still isn’t fixed, it’s a good idea to repeat all this again and delete their home folder too. Just make sure to make new backups for when anything has changed.

Step 5 – Next go into the Registry Editor on that machine. You can do this by clicking the start button and just typing “Regedit” into the search box. Older versions of windows you can do this by clicking Run and entering “regedit”

Step 6 – Go to the following Key:
HKEY_LOCAL_MACHINESOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.
You’ll see a bunch of sub folders and keys that look something like S-1-5-1533239630-186…. Obviously yours will be slightly different from mine so I will only give a random example. Click through the folders with the longer names and you’ll see they contain a key called “ProfileImagePath”. Look for one where that key’s value is the folder you deleted before. When you find it; delete that containing folder on the left (the S-1-5-21-143152534-1231432-1222 one, not the ProfileList folder). This will avoid the “Temporary Profile” error that Windows 7 is prone to have when you just delete the folders.

Step 7 – Log out of your administrator account and reboot the computer.

Step 8 – Have the user log in again. They’ll notice their desktop is mostly blank, documents are gone and so forth. Just move the files you backed up back into their proper folders and the next time they log in they’ll see them.

Step 9 – Set them up on that computer as if they were new. Get Outlook setup, replace any printers that aren’t automatically deployed, etc.

Step 10 – Have them reboot the computer after you’re done and they should be good to go.

It seems complicated but all  you are really doing is basically the following:

  1. Backing  up their stuff.
  2. Deleting their Profile files.
  3. Having them log in as if for the first time.
  4. Putting their stuff back

It’s amazing the kind of weird problems this process fixed. Typically I use this as a last resort if I can’t actually fix whatever problem they are having. The reason for this is because the system thinks they have literally logged in to that computer for the first time. If you deleted all their network paths its just like they logged into the network for the first time. So they will have to set everything up like it used to be. That means desktop layout, background picture, and everything.
If you’re a home user and have odd problems that seem to defy explanation this will work for you too. Just do the steps and ignore the part about network folders.  Back up the stuff in your Documents, Videos, Photos, Downloads, Favorites, and whatever other folders (click on your name in the start menu to see these) by copying them to an external drive.  Delete the C:\users\yourname folder (log into a separate administrator account first). Then do step 6, and then log in as yourself and put all your stuff back into the right folders (don’t just drag the folders back, actually copy the contents from the backed up ones to the new ones). This is also a quick way to reorganize your stuff too.

Leave a Reply

Your email address will not be published. Required fields are marked *