Creating an automatic logon for your Windows server

Do you get tired of having to log on to your server by pressing [Ctrl][Alt][Del] and providing a password? Fortunately, there's a way you can bypass this process. In this Daily Feature, John Sheesley shows you how.

As you know from years of working with Windows NT, before you can do anything on your server, you must log on. The traditional way of doing so is by pressing [Ctrl][Alt][Del] and providing a password when the server starts up. The procedure’s the same for Windows 2000. But what if you want to bypass this process and just make your server automatically log on? You can do this by taking a little trip into the registry. In this Daily Feature, I’ll show you how to do this on both Windows NT and Windows 2000.
This Daily Feature suggests that you make changes to your server’s registry. Make sure that you have complete backups of your server before doing anything mentioned in this article. If you make a mistake when making changes to the server’s registry, you may cause your server to become unbootable, which requires a reinstallation of Windows. Proceed with extreme caution.
Why would I want to do such a thing?
Normally, disabling the logon prompt is not a good idea. The logon prompt provides an extra layer of security for your server. Without knowing the administrator ID or password, a wayward user can’t just walk up to your server and randomly make changes to it. Also, by not having the administrator account logged in to your Windows server, you keep the account name hidden from hackers who can use utilities to discover the identity of the administrator account. Finally, this isn’t a good idea because the procedure I’m going to describe stores the administrator password in clear text in the registry where prying eyes might be able to find it.

There may be instances, however, where you want to have your server log in automatically. The main reason would be if you have services or programs that you can run on your server only when the administrator is logged in to the system. If the server reboots for any reason when you’re not around, these services or programs won’t be able to run because the server will restart to a logon prompt.

Of course, another reason is just sheer laziness. It takes a lot of effort to press [Ctrl][Alt][Del] and type in a password. It's not a good one, but it’s a reason.

Where angels fear to tread
Making your servers automatically log on when they start requires you to make some changes to your server’s registry. The procedure is identical in both Windows NT Server and Windows 2000 Server. To begin the procedure, select Run from the Start menu. Type REGEDT32 at the Run prompt and click OK.

When the Registry Editor starts, navigate the hives in the left pane until you get to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
WindowsNT\CurrentVersion\Winlogon key. Check the DefaultUserName entry in the right pane and make sure that the value is set to your Administrator account. If it isn’t, double-click the field and enter Administrator or the name of your administrator account in the String field. Click OK when you’ve finished.

Next, look to see if there’s a DefaultPassword entry in the right pane. If you don’t see it, select Add Value from the Edit menu. In the Value Name field, type DefaultPassword. Make sure that REG_SZ appears in the Data Type list box and click OK. When the String Editor screen appears, type your Administrator password in the String field. Make sure you type the password properly. The Registry Editor won’t ask you to double-check it, nor will it compare the password to the Administrator password stored in Active Directory or NT’s SAM database.

Now, select Add Value from the Edit menu. In the Value Name field, type AutoAdminLogon. Make sure REG_SZ appears in the Data Type list box and click OK. When the String Editor screen appears, type 1 in the String field.

To finish, just close the Registry Editor. Changes you make are automatically saved. Restart your server. When you do, your server will go straight to the Desktop, logged in as Administrator.

There are a few things to be aware of when you do this. First, as previously stated, the procedure stores the Administrator password in clear text in the registry where prying eyes might be able to find it. This isn’t necessarily a good thing.

Second, with Windows 2000, when you log off as Administrator from the Start | Shutdown procedure, it asks you to log back on the old-fashioned way. Windows NT, on the other hand, just logs straight back in.

Microsoft says that you can use the ForceAutoLogon key to force Windows 2000 to automatically log back in when you log off from the Start menu. All you have to do is add the key with a value of 1 in the same area of the registry where you added the other keys.

This key worked perfectly under Windows 2000, but I was unable to get it to work in reverse under Windows NT. In NT, this key doesn’t exist, so I added it with a value of 0, hoping to prevent an automatic logon after logging out. No such luck. NT always automatically logged on.
The authors and editors have taken care in preparation of the content contained herein but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.

Editor's Picks