Solved

Login Script

Posted on 2004-08-20
7
246 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
Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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