Sunday, July 24, 2011

How to delete a user profile in Vista, Windows 7 and Windows 2008?

Apart from going to the Users folder and deleting the profile one must also go to the registry as shown below and delete the key corresponding to that user. In my case I needed to know a SID of a user after the user was disabled and deleted from AD. Looking at the profileImagePath one can cross check the user associated with the SID.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1659004503-1788223648-1417001333-500]
ProfileImagePath”=”%SystemDrive%\Documents and Settings\User1”
“Sid”=hex:01,05,00,00,00,00,00,05,15,00,00,00,57,66,e2,62,a0,20,96,6a,75,b9,75,54,f4,01,00,00
“Flags”=dword:00000000
“State”=dword:00000100
“CentralProfile”=”"

No comments: