62

I'm wondering how to safely remove a domain user profile from a computer that is a part of a domain. I don't want to delete the account from the domain itself, I just need to remove the profile from this computer, to do some cleanup.

I'm currently on a Vista Business computer, but we also have Win XP Pro and Win 7 Pro.

Dan
  • 15,280
  • 1
  • 35
  • 67
Zlatko
  • 1,001
  • 2
  • 11
  • 21

5 Answers5

107

Method 1 (easy and safe)

  • Open up "Control Panel | System and Security | System"
  • In the dialog click on "Advanced system settings" (requires Admin rights)
  • The "System Properties" dialog will be displayed
  • Make sure you are in the "Advanced" register
  • In the "User Profiles" section click on "Settings"
  • The "User Profiles" dialog is displayed
  • Select the account. Hit Delete.

Method 2 (slight variation of method 1)

  • Start | Run
  • sysdm.cpl
  • switch to register "Advanced"
  • In the "User Profiles" section click on "Settings"
  • The "User Profiles" dialog is displayed
  • Select the account. Hit Delete.

The greyed out button possibly means that the registry hive has not been released by the operating system, as pointed out by @joeqwerty in the comments.

Method 3 (manual and prone to errors)

Delete the C:\Users\[ACCOUNT] directory. That leaves some registry entries behind that have to be manually deleted as follows.

  • Open Regedit with Administrator Permissions (Runas Administrator)
  • Select the HKEY_USERS branch
  • Search for the Domain Account without the domain (e.g. login = DOMAIN\ACCOUNT then search for ACCOUNT)
  • Keep on searching until the status bar shows Computer\HKEY_USERS\[SID]\Software\Microsoft\Windwos\CurrentVersion\Explorer\Shell Folders
  • There should be a large list of your ACCOUNTs folders e.g. C:\Users\ACCOUNT\Desktop

You are in the right HKEY_USERS\[SID]\Software\Microsoft\Windwos\CurrentVersion\Explorer\Shell Folders branch if the ACCOUNT in "Shell Folders" matches the ACCOUNT you just manually deleted form the C:\Users\[ACCOUNT] directory. This branch [SID] can be exported and/or deleted to clean up the last of the user profile.

ndemou
  • 1,215
  • 2
  • 16
  • 27
John K. N.
  • 1,955
  • 1
  • 16
  • 26
  • Accepted because of the group policy addition :) – Zlatko Nov 20 '12 at 12:27
  • 2
    Thanks. I've just added another portion about manually deleting the registry entries if you manually deleted the C:\Users\ACCOUNT directory. – John K. N. Nov 20 '12 at 12:31
  • 7
    I've never heard of any group policy setting that can "protect" a user profile. If the Delete option is unavailable the most likely reasons are: You're trying to delete the profile for a currently logged on user OR Windows hasn't released the registry hive for the user profile, in which case you can reboot the machine and then delete the profile. @hot2use - Can you provide a link to a group policy setting that would "protect" the user profile? – joeqwerty Nov 20 '12 at 14:32
  • @joeqwerty you are right, there is no policy. I was assuming it _...could be protected ..._, as I don't have the greyed out behaviour on my home computer. Only on my corporate laptop. I've 1+ your comment. – John K. N. Nov 21 '12 at 07:47
  • 3
    A quick way to locate the user to its SID is by right clicking the SID folder and looking at permissions. The user should have permissions for their own branch. – seanjacob Nov 28 '14 at 15:23
  • I have a domain user and the 'Delete' button is disabled... – inon Aug 30 '17 at 06:03
  • As pointed out by [@joeqwerty](https://serverfault.com/a/450397/145804) (comment to my answer) and [@Btran](https://serverfault.com/a/735019/145804) (separate answer) you might have services running with the domain account on your computer. Then you have to change the service account of the services and reboot. – John K. N. Aug 30 '17 at 06:19
  • 1
    For Windows 10 just do `WIN`+`X`--> `Settings` --> Search for `Advanced system settings` and follow the last three steps from the solution above. – Weishaupt Oct 26 '17 at 13:30
  • Is there a quicker (more efficient) way to clear the whole registry keys of `ALL DOMAIN ACCOUNTS`? I think one of our IT guy just deleted the folders manually, now we are having problems with log-on, (Windows 7) it kept saying `profile failure` – Chen Stats Yu Sep 11 '18 at 20:41
19

In case if user profile folder is/was deleted manually, you need to make changes to registry

1. Open "regedit.exe"

2. Navigate to "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"

3. Click the sub-key that corresponds with the profile you deleted and right click and delete it.

Volodymyr Molodets
  • 2,404
  • 9
  • 35
  • 52
  • 5
    This one does not answer the question per say, but it's EXTREMELY useful to write this down if you ever need it. It's a pain to troubleshoot when someone else have manually deleted a profile on Vista or newer.. – pauska Nov 20 '12 at 09:12
  • @pauska Agreed, for those who don't know, manual deletion prevents user logon on Vista / 7. – Dan Nov 20 '12 at 09:12
  • Agree, this would be better to append this to already provided answers, but nobody mentioned what exactly should be corrected in registry. I do not mind merging with another answer :) – Volodymyr Molodets Nov 20 '12 at 09:14
  • @inhabitant It's fine as it is, IMHO - keep the rep :) I was too lazy to double check when I wrote mine. – Dan Nov 20 '12 at 09:18
12

The safest method is as follows. (Written on Windows 7, but applicable to XP onwards)

  • Go to Start
  • Right click "Computer and select Properties
  • Select Advanced System Settings [Skip this step on XP]
  • Choose the Advanced Tab
  • Under User Profiles, select Settings (NB: This may take some time to enumerate)
  • Select the username you wish to delete and select Delete

This will remove any profile data on the local machine. Do not be tempted to just delete the profile directory as this will leave registry entries behind that will cause problems on Vista onwards.

I also recommend "RemProf" from the excellent Ctrl-Alt-Del TS Util Pack. Ignore that the pack is terminal services centric, the utility works fine on desktop editions. Just note the different versions for XP/2003 and Vista/7/2008/R2

Dan
  • 15,280
  • 1
  • 35
  • 67
2

If the account is grayed out, then the account has Windows services or scheduled tasks tied to it. You will need to change the account on these services or task. Once done you will have to re-boot the PC and then it will allow you to delete the profile.

BTran
  • 29
  • 1
1

TLDR

Run sysdm.cpl > Advanced > User Profiles > Settings > User Profiles > Select the account > Delete.

If "Delete" is greyed out

Most likely some process/service is running under this account.

  1. Double check that the account is not signed in (Task Manager > Users).
  2. Check if any process appears running under that account (Task Manager > Details > Short by User Name). If it is, find out why it runs like that and change it. If, for example, you have a service using that account then you change the service account and restart the service.
ndemou
  • 1,215
  • 2
  • 16
  • 27
  • Based on the accepted answer by John aka hot2use which I was too chatty for my taste and was missing the troubleshooting steps. He rejected my edits so I added this one. – ndemou Dec 15 '20 at 08:54