I want to change HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\winlogon and change the value of DefaultUserName. How I can do it?
Because this is not a policy setting in Group Policy management but a regular registry key, you would need to create a custom ADM file which will then allow you to change this key. Be warned, however, that this will only allow you to set this as a "preference" rather than a true policy. We have a lot of information about this phenomenon at GPanswers.com. Just note the setting can be overwritten by other processes, such as in the case you mention where this key is in fact written over at logon to hold the name of the last user who logged in.
If you are trying, specifically, to get the machine to log on automatically with a particular user account you would be better off using a third-party tool such as TweakUI.
If you are simply trying to hide the name of the last user who logged in you can use the policy setting at:
Computer ConfigurationWindows SettingsLocal PoliciesSecurity Options Interactive logon: Do not display last user name
Dig Deeper on Microsoft Group Policy Management
Related Q&A from Jeremy Moskowitz
Can I append Domain Groups to the local 'Admin' Group of Domain Computers without affecting the exis
Expert Jeremy Moskowitz explains what an admin would need to do to append Domain Groups to the local 'Admin' Group of Domain Computers without ...continue reading
How can I restrict rights for a group of users on a specific OU of computers, but not on any compute
Expert Jeremy Moskowitz shows a reader how to use loopback policy processing to restrict rights for a group of users on a specific OU of computers.continue reading
Expert Jeremy Moskowitz explains how to use Group Policy for a Windows 2000 Server to apply proxy settings automatically on all the workstations in a...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.