Sometimes there is software which runs on a Windows Server which can’t be started at a service. The easiest way around this is to Automatically Logon to the Server, Automatically Start the Software and then Automatically Lock the Windows Server.
There are three steps that you will need to complete to accomplish this.
1. Set up the Windows Server to Automatically Logon upon reboot.
This article will assume you are already familiar with working in the registry editor.
Step 1
First of all you will need to open up the registry editor on the server. – Start > regedit
Step 2 – Navigate to the following registry subkey
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
The following strings need to be set. If any of the strings are not present you will need to create a new String
- AutoAdminLogon – 1
- DefaultDomainName – Your Domain Name
- DefaultUsername – Your Username
- DefaultPassword – Your Password
Please Note:
To bypass the AutoAdminLogon process and to log on as a different user, press and hold the Shift key after you log off or after Windows restarts.
If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.
2. Automatically Start the Required Program
This one’s a simple as creating a shortcut to the program and adding it to your users startup directory.
3. Automatically Lock the Server after Logon
Step 1 – Create a new Notepad Document and place the following text in it
@echo off
%windir%\System32\rundll32.exe user32.dll,LockWorkStation
exit
Step 2
Save the autolock as a batch file. Be sure to change the “Save as Type” to All Files (*.*)
Step 3
Create a shortcut to the batch file and add to the users startup directory.
Security Implications
If you haven’t already noticed, the password for the computer is now stored in the Windows Registry as Plain Text. If the password is sensitive to others using the same server this probably won’t work for you. Anyone who has permissions to log on to the server will be able to go to the registry editor and see the password. In smaller environments this isn’t an issue but for larger corporations it may.
This is good, but how to lock auto-logged admin to rebooted server after the FIRST auto-login only? I need auto-login and lock the 1st server administrator, let him dtart some automatic sql jobs. Locked server should be then simply accessible for the 2nd admin and of course the 1st admin also…. This leads into endless loop… This way the 1st admin will be always locked after logon. Any idea? Pressing Shift is not the ideal solution… Thanks!