Solved

Login Script

Posted on 2004-08-20
7
245 Views
Last Modified: 2010-04-14
I need help writing a script that will auto login a certain user account.  Be it the local admin, or a domain user.
0
Comment
Question by:SCP028
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 15

Accepted Solution

by:
scampgb earned 125 total points
ID: 11851353
Hi SCP028,

Here's a bit of VB script that should do what you want:

  Set WshShell = WScript.CreateObject("WScript.Shell")
  WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\DontDisplaylastUsername",   "0",   "REG_SZ"
  WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultUserName",   username,   "REG_SZ"
  WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultDomainName", "MYDOMAIN", "REG_SZ"
  WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultPassword",   password,   "REG_SZ"
  WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\AutoAdminLogon",    "1",         "REG_SZ"
  WshShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\LegalNoticeText"
  WshShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\LegalNoticeCaption"
  Set WshShell=Nothing

I hope that this helps - let me know if you need any further help.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 11851363
Could it be that you look for using the RunAs Service ?
Here for Windows Server 2003:
http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/windowsserv/2003/standard/proddocs/en-us/windows_security_runas_shortcut.asp

Note that you will ALWAYS need to type the password in there :)

What is the intention of the scripts?
0
 
LVL 2

Expert Comment

by:vet716
ID: 11851563
If you want the computer to auto login when it reboots there is an easier way than using a script.

Take a look at the link below for a very easy registry change:

http://www.winguides.com/registry/display.php/13/

For Win 2K you will need to make this change as well:

http://www.winguides.com/registry/display.php/780/
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:SCP028
ID: 11852083
Vet,

This is doing the same thing that scam's script is doing.
0
 

Author Comment

by:SCP028
ID: 11852091
Scam,

Thanks for the script.  I will be testing it after lunch, but it looks like it should work.
0
 

Author Comment

by:SCP028
ID: 11852167
Angel,

The reason i need this information is because my company is changing from an old NT Domain to a new 2003 domain.  Along with this change, we are changing domain names.

I am in charge of the client machines, and making sure all user data gets transfered.  So i have been researching and finding numerous scripts that will allow me to:

1.  Change domains
2.  Copy user profile from old to new
3.  take olddomain\username from local admin group and add newdomin\username to local group

A few of these scripts will have to auto-login and run, which is why i need the script.  

Thanks for the pointer to the run as shortcut.
0
 
LVL 15

Expert Comment

by:scampgb
ID: 11852682
Hi.  Thanks for the "A".  Glad I could help.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question