Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Login Script

Posted on 2004-08-20
7
Medium Priority
?
250 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 500 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
Check out what's been happening in the Experts Exchange community.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

688 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