Thursday, September 23, 2010

Windows 7: Auto Login to Domain Account and lock the desktop right away

I saw this blog post in Life Hacker (Make Windows load your desktop before you log in) and see the interesting idea which I used to do few years ago. That Life hacker post is for home users. It doesn’t apply to the domain computers, obviously. So I decided to explain how to auto logon with Domain account and lock your desktop on start up. Here it is.

  1. Open Registry Editor (Start Orb –> type Regedit.exe)
  2. Browse to this location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Edit DefaultUserName key and type your domain user name
  4. If doesn’t exist, Create DefaultDomainName (string or REG_SZ) key and edit it with your domain name
  5. If doesn’t exist, create DefaultPassword (string or REG_SZ) key and edit it with your password
  6. If doesn’t exist, create AutoAdminLogon (string or REG_SZ) key and edit with “1”.
  7. Close Registry Editor
  8. Open Notepad
  9. Type this: WScript.CreateObject("WScript.Shell").Run("rundll32 user32.dll,LockWorkStation")
  10. Save it as “LockDesktop.vbs” (NOTE: you have to type script name in double quotes, or it will save it with “.txt” in the end) to a known location (would say Documents\scripts in your profile)
  11. Click Start –> All Programs. Right click on Startup and select Open.
  12. On Startup Folder, right click on empty space and select New –> Shortcut.
  13. Select your script (LockDesktop.vbs) on your saved location and create a shortcut.
  14. That’s it. Reboot your computer and watch your computer auto login with your account and locks the desktop right away.

Make sure have a plan to change the password when your password expires in the registry (DefaultPassword key). I would create a local user account and have it handy just in case. Enjoy!

No comments: