If you deal with imaging a lot, you’ve probably run into a situation where you have some local users on a workstation that you don’t want to be there, maybe they were creating during the OS install or whatever. It’s also handy if you are moving someone to a domain setup, and need to get rid of their old local accounts to prevent them from logging in as the local user instead of the newly created domain user.
You need only paste the following into a plain text file, and rename the extension to .vbs:
strComputer = “.”
strUser = “user”
Set objComputer = GetObject(“WinNT://” & strComputer & “”)
objComputer.Delete “user”, strUser
Next, create a new GPO, add .vbs this as a startup script under Computer Settings, associate with an existing OU containing you domain computers.