How to login a user (so that a program runs ) automatically after reboot. RRS feed

  • Question

  • We have a server - running server 2016 OS.

    We have a user account domain1\user1 - who can login.

    When they login a program is setup to run automatically.

    (You can see this if you look in

    C:\Users\user1\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    - there is a shortcut to the program - that starts when user1 logs in)

    After a reboot of the server - we need to simulate user1 logging in  - so that the program starts after reboot (it wont run as a service).

    I have tried running sysinternals autologin - to enable Autologins for user1 - but this does not cause the program to be started after reboot ( ( icannot see that user1 as a looged in user after a reboot - i.e. when i check by loging in as a different user)

    We dont want passwords in the registry as plain text.

    Monday, March 9, 2020 7:40 PM

All replies

  • Autoruns works even on Windows Server 2019. Password are stored as security token in the secure zone of the registry not as clear text. Latest version is 3.1.

    Try to run again Autologon, and after that before rebooting, enable Procmon boot log, so the next boot will be traced from the beginning and you will see why the user is not logging in or why the exe is not starting..

    You can also trace Autologon to see if it is working fine using ProcMon.

    Also, you can try using a scheduled task at Logon to start the process or the registry key 



    Tuesday, March 10, 2020 7:26 AM
  • I still cannot get this to work.

    I have added the reg keys for 

    AutoAdminLogon = 1

    ForceAutoLogon = 1

    ForceUnlockLogon = 1

    Running sysinternals autologin - and enabling logins for user1 adds the username and domain to the registry keys for 



    But when the server is rebooted no session is created for the account. i.e. when i login as user2 (via RDP) - only user1 is listed in the Users in task manager. I have setup a scheduled task to run when user1 logs on - but its not running.

    • Edited by goofygdog2 Tuesday, March 10, 2020 12:33 PM
    Tuesday, March 10, 2020 12:33 PM
  • What OS version are you running? what Autologon version are you running?

    Try collecting a boot log trace with ProceMon and at the next boot collect the trace and try to see what's going on with your user1 session..


    Tuesday, March 10, 2020 12:54 PM
  • Server 2016 OS

    I have done a boot log trace with procmon - but there is no sign that a user1 session is being created at logon.

    Tuesday, March 10, 2020 5:07 PM
  • This is my test environment. I created a domain user called Pippo. Used it to logon locally via the Hyper-v console to the machine in order to create the user's profile and set the Run key in order to start automatically notepad.exe when autologon.

    Then on a remote session to the same server where I was connected as another user which is administrator on the server, I started Autologon to configure the user to automatically logon.

    And as you can see from the procmon log, Autologon creates the key DefaultUserName, DefaultDomain Name and AutoAdminLogon. It saves the password via Lsass under the secret section of the registry.

    Then I configured the run key via the registry for the user pippo, and set Procmon to collect a boot log for the server. Finally i restarted it. Being this an Hyper-v server, I connected to the console via the Hyper-v connection manager just to sse the autologon happen.

    And it worked fine.. This is the Boot log Process Tree:

    As you can see the user Pippo logs on and userinit starts Notepad.exe.

    The procmon trace shows exactly when this happens:

    As you can see LogonUI check the presence and value of autoadminlogon. Then check for the defaultusername and then load the password from the secret in the registry and perform a logon to the console of the server.

    This is Windows 2016.. so it works like a charms..

    If you are expecting to get a TS session from autologon, that won't happen, because autologon works at the console session. but as long as the user has the right to logon to the server (remember that there may be some domain policy disabling the possibility for domain users to logon to server machine) and you tested it logging on locally so to create the user's profile and set eventually an autoruns program, this work.

    Try looking in your trace for the autoadminlogon check.. you should find the same thing I found. If you find them, that is if the process start looking at the user profile to load, and then it stop working, it is probably because of a policy that deny the logon locally to domain users..

    I cannot think to anything else going wrong..

    Eventually share the procmon boot log.


    Tuesday, March 10, 2020 6:29 PM