none
Auto relogin after reboot

    Question

  • As the title says already. Is it possible, that the system automatically logs you in again after rebooting? Or is that locked or something.
    Tuesday, August 14, 2012 1:09 PM

Answers

  • Not sure if your interested, but I noticed this on google.   Here is a free 3rd party powershell cmdlet for auto-logon control.   Haven't tried it myself, report back if successful.

    http://www.vexasoft.com/cmdletlibrary/support/setautologon.html

    Otherwise BT is right, just a few easy changes in the registry.   Let me save you 5 minutes of reading, here is a .reg file

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "DefaultUserName"="Administrator"
    "DefaultPassword"="Password"
    "AutoAdminLogon"="1"
    "ForceAutoLogon"="1"

    and if you must do from powershell, I guess this will do the trick.

    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultUserName -Value "Administrator"
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultPassword -Value "Password"
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoAdminLogon -Value "1"
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name ForceAutoLogon -Value "1"


    Wednesday, August 15, 2012 9:41 AM
  • Yes, I appreciate your problem, but you haven't thought this through really.  It is not technically possible to do what you want.  The best you can do is silent installs, which could reboot automatically if there is a switch for that.

    Alternatively, as you said, you could reboot the machine at the end of the install.


    Grant Ward, a.k.a. Bigteddy

    Friday, August 24, 2012 8:37 AM

All replies

  • Auto logon can be set in the Registry.  See the following article:

    http://support.microsoft.com/kb/315231


    Grant Ward, a.k.a. Bigteddy

    Tuesday, August 14, 2012 1:20 PM
  • Not sure if your interested, but I noticed this on google.   Here is a free 3rd party powershell cmdlet for auto-logon control.   Haven't tried it myself, report back if successful.

    http://www.vexasoft.com/cmdletlibrary/support/setautologon.html

    Otherwise BT is right, just a few easy changes in the registry.   Let me save you 5 minutes of reading, here is a .reg file

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "DefaultUserName"="Administrator"
    "DefaultPassword"="Password"
    "AutoAdminLogon"="1"
    "ForceAutoLogon"="1"

    and if you must do from powershell, I guess this will do the trick.

    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultUserName -Value "Administrator"
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name DefaultPassword -Value "Password"
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoAdminLogon -Value "1"
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name ForceAutoLogon -Value "1"


    Wednesday, August 15, 2012 9:41 AM
  • Before trying this out and rebooting my laptop, it looks like I have to fill in the name and PW there, don't I? Because we have several users logging on here and it should automatically login as them and not only as the same user.
    Friday, August 24, 2012 7:59 AM
  • How will the computer know who is using it?

    Grant Ward, a.k.a. Bigteddy

    Friday, August 24, 2012 8:07 AM
  • I don't know, maybe you know, that's why I asked.
    Friday, August 24, 2012 8:10 AM
  • So, you want the computer to automatically log in to the correct user as that user sits down in front of the computer.  You want the computer to somehow "sense" and identify the individual, and log on accordingly.

    Is that what you want your script to do?


    Grant Ward, a.k.a. Bigteddy

    Friday, August 24, 2012 8:17 AM
  • Someone starts the computer, logs on as "Body" (for example) and it will save that "Body" including its password and logs in as "Body" after rebooting.
    Friday, August 24, 2012 8:19 AM
  • Then once "Body" is logged on, the auto-logon settings must be set to "Body".  Thereafter, no-one else will be able to log on, because the auto-logon settings are already set.  What you are asking is impossible, and doesn't make much sense.

    Grant Ward, a.k.a. Bigteddy

    Friday, August 24, 2012 8:27 AM
  • Thinking of a group of companies with 18k workers.

    Thinking of installing up to 100 applications for a new laptop/computer.

    Thinking of sometimes rebooting for full installations for the applications.

    Thinking of sitting in front of the laptop/computer for several hours, just to re-login several times because it doesn't auto-login.

    Maybe it now makes more sense.

    But I can also make the laptop/computer reboot at the very end of the whole installation and hoping it will work.


    I'm new to Powershell and I can't edit my profile because it doesn't save. :/


    Friday, August 24, 2012 8:31 AM
  • Yes, I appreciate your problem, but you haven't thought this through really.  It is not technically possible to do what you want.  The best you can do is silent installs, which could reboot automatically if there is a switch for that.

    Alternatively, as you said, you could reboot the machine at the end of the install.


    Grant Ward, a.k.a. Bigteddy

    Friday, August 24, 2012 8:37 AM
  • Hmm, strange. I've just seen in the older installation (XP) they got it to work but I don't know which program language they used there, propably not powershell. And these guys here want me to do it with powershell (for Win7 applications).

    Whatever, thanks for your information.


    I'm new to Powershell and I can't edit my profile because it doesn't save. :/

    Friday, August 24, 2012 8:41 AM
  • Livio can you not use one and the same local user with admin rights during the installation and then once all is finished remove the auto logon? you could temporary set the computer to logon with the local admin act ( or another one with equal priviledges if you prefer not to use the local admin act )

    Like what others said before setting an auto logon with different users on the same machine is impossible. with one user for install purposes it can

    Monday, September 03, 2012 6:42 PM
  • The point is, the script I'll use, will be in use on several laptops and computers. We also have several admins here and not only one. If we would only have one local admin, than we would have to change the whole system in our company.

    Lua Programmer & Powershell Newcomer | Location: Switzerland

    Tuesday, September 04, 2012 6:24 AM
  • I mean the default localadmin account which is being created when you install a machine... not a persons act...
    Or create a script that asks you to specify the credentials you want to set  ( ie administrator1/password1 or so ) and then set those in the autologon...
    Tuesday, September 04, 2012 12:12 PM
  • We do this through the network. We set up all machines the same way. There isn't really a "local" admin because there are just several people allowed with global rights and can set up the machine. When you start up any machine, it asks you to login with an account from a specific domain. When setting up, the same things happens, which means, we have our images on a server and download them right there. So we got to connect it via the LAN.

    The only thing I want to do is. When the user logs in (with the admin rights), it should automatically detect and save the username, includiing the pw to the credentials so I can later just use this information to make it autologin at reboot. (I think I'm using bad English right now) Problem is, there are several users with admin rights, and you never know, which one logs on.

    But I think basically, it will not be that necessary anymore. I think we found some workaround for this already.


    Lua Programmer & Powershell Newcomer | Location: Switzerland

    Tuesday, September 04, 2012 12:29 PM
  • The users here have almost answered your usecase.

    Assuming all users have the same password, and you're happy to store it in plaintext in the registry, you can write a simple script to clone the value of the LastUsedUsername registry key into the DefaultUserName registry key when a user logs in.

    That should allow the users to have a persistent login across reboots, at the cost of unique passwords.

    A simple variation on this would be to integrate with some kind of password vault (preferably one that integrates with active directory), and update the password at the same time that you update the username. I know of no solution, out of the box, that does this however.

    Wednesday, March 13, 2013 10:13 AM
  • I made powershell prompt for all usernames and passwords at the very beginning, so the user has to type in all usernames and passwords, which will be saved into the registry and can be used everytime. I also changed it with the active directory. Before ADDS gets installed, I change the autologin username, password and domainname.

    The following is my signature:

    Powershell Programmer & Advanced Lua Programmer

    Location: Switzerland

    Beside that, whenever you see a reply, you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the main question of the thread, click "Mark As Answer" (if you opened the thread).

    I published the URL's for the icons in my signature.

    Please contact me, before reporting me, thank you.

    [string](0..21|%{[char][int]([int]("{0:d}" -f 0x28)+('577076797174-87661607769657424-8687168065964').substring(($_*2),2))})-replace' '

    Friday, March 15, 2013 7:56 AM