Force autologon after logging off

This isn’t strictly SharePoint-related, but might be useful to a sysadmin somewhere…

I have a few servers that are running old-fashioned console apps (meaning that there always has to be a specific user session logged in for these apps to run properly). The server is configured with an autologon feature so when the system is restarted (after patching or a power outtage), the apps are also automatically restarted.
Sometimes these apps will stop responding, and we need to restart them using a script; however, we don’t want to restart the entire server.
The problem I ran into was, if you just log off the user session, it doesn’t automatically log back in – it gets stuck on the username/password screen.

It turns out, there is a registry setting that controls this behavior. Here it is:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ForceAutoLogon

This is a string value; if you set it to 1 (and configure the remaining registry values for auto-logon), then when you log off, Windows will log you right back in.

Advertisements

3 Responses to “Force autologon after logging off”


  1. 1 hans January 13, 2011 at 10:01 am

    See this article which shows several ways how to configure Windows autologon, could be useful addition for this post. Thanks

  2. 2 mariano August 28, 2016 at 11:38 pm

    Is there eny way to logoff a session and start another one (that open a client with VirtualBox) and that the logon just one time works? I mean just one force autologon

  3. 3 santi October 5, 2016 at 3:54 pm

    mariano, try using the System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
    Value Name: AutoLogonCount
    Data Type: REG_DWORD (DWORD Value)
    Value Data: Number of Automatic Logins


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




RSS Information Week Headlines

  • An error has occurred; the feed is probably down. Try again later.

RSS SharePoint Team Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS InfoPath Team Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS Joel Oleson Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS Susan Hanley’s KM Blog

  • An error has occurred; the feed is probably down. Try again later.

Blog Stats

  • 348,184 hits

%d bloggers like this: