I'm setting up a WIM to image a set of laptops. I have setup a computer which I have sysprep'ed and then captured the image to the WDS server. I have deleted all the local user accounts using the control panel. However when I image a computer from the WIM there are 3 or 4 local user accounts already on the system. How can I get rid of them, or ideally not include them in the image capture in the first place?
Before you run your final sysprep to prep the image for capture, put the machine into audit mode with
sysprep/audit
and clean out the profiles you don't want in there. Then run your final sysprep and the machine will shut down and you can image it.You can also do other administrative things in audit mode. You can read more about it here.
While I would suggest dealing with this around the SysPrep stage of the image, I think you can indeed do a dirty if circumstances demand it...
DISM /Mount-WIM /WimFile:<C:\path\tomy\file.wim> /index:1 /MountDir:<Empty folder to populate with WIM files>.
C:\users
HKEY_LOCAL_MACHINE
and then select File: Load Hive.<Path to WIM Mount Dir>\Windows\System32\Config\SOFTWARE
. Give the opened Hive a name, as directed.HKLM\<WIM Hive Name>\Software\Microsoft\Windows NT\ProfileList
ProfileList
subkeys for the profiles you want to delete and note theGUID
value.GUID
subkey from theProfileGUID
key situated directly above theProfileList
keyProfileList
subkeys for each user that you want to remove.File : Unload Hive
and then close RegeditWindows\System32\Config
folder, select the Security tab and remove the current user account from the List of permissioned accounts.DISM /Unmount-WIM /MountDir:<Empty folder to populate with WIM files> /Commit
After that, your WIM will no longer have those user accounts... I'd be interested to see feedback on this method, as there are likely insidious problems with it.