Solved

Login Script

Posted on 2004-08-20
7
241 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now