Solved

Login Script

Posted on 2004-08-20
7
244 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
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 142

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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

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…
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

825 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