Solved

How do I set default user name and domain name instead of last user logon

Posted on 2003-11-01
10
885 Views
Last Modified: 2010-04-11
    I and many of my colleagues frequently visit client's computers for various tasks. I set down login as local administrator complete my task and reboot. I don't know their passwords nor their login names and don't want to know either. Is there a way I can setup their computers so no matter who successfully logs in before the reboot the default Username has that clients username; the default domain name is the domain they log into (we have multiple domains) and the password box is left blank. NO THIRD PARTY SOFTWARE!!!!!  In some cases 3rd party software works great but I will not guarantee points to be awarded because we are not a 3rd party shop. So be warned.
0
Comment
Question by:Fubyou
[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
10 Comments
 
LVL 8

Expert Comment

by:SNilsson
ID: 9663959
0
 

Author Comment

by:Fubyou
ID: 9664268
THIS ABOVE ANSWER IS WRONG.

PLEASE AT LEAST READ THE QUESTION BEFORE ANSWERING.

0
 
LVL 26

Expert Comment

by:Soulja
ID: 9664822
Are you logging into Active Directory domains? If so, why can't the user just type in "username@domain.com" for their username. That way they won't need to select their domain.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 4

Expert Comment

by:Netelligen
ID: 9665142
Possibly I am misunderstanding what you are asking for, but I will give it a shot.

You can easily setup a script at logoff (if you are using Win2K or XP) to modify the registry.

The keys you would modify are:

HKLM/SOFTWARE/Microsoft/WindowsNT/CurrentVersion/Winlogon/DefaultUserName

and

HKLM/SOFTWARE/Microsoft/WindowsNT/CurrentVersion/Winlogon/DefaultDomainName

You could call a .reg file (like logoff.reg) that had something similar to the following in it:
-------------------------------------------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultDomainName"="CLIENTDOMAIN"
"DefaultUserName"="clientusername"
-------------------------------------------

Let me know if this is what you were looking for

Netelligen
0
 

Author Comment

by:Fubyou
ID: 9665153
That answer was actually amusing.
0
 

Author Comment

by:Fubyou
ID: 9665158
Yea thats it Netelligen. I went to the microsoft site and downloaded some script maker. And I know I should write a script but am not sure how to write it exactlly. But you are on the right track.
0
 
LVL 4

Accepted Solution

by:
Netelligen earned 250 total points
ID: 9665208
So, here are the scripts... the first one reads the DefaultUserName and DefaultDomainName keys and creates NEW keys, called LastUser and LastDomain, with the appropriate info.  The second one reads from LastUser and LastDomain and sets the DefaultUserName and DefaultDomainName keys to those values.

getlastlogon.vbs
-------------------------------------------
Set WshShell = WScript.CreateObject("WScript.Shell")

strLastUser = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName")
strLastDomain = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName")
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LastUser", strLastUser
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LastDomain", strLastDomain

Set wshShell = nothing
-------------------------------------------

setlastlogon.vbs
-------------------------------------------
Set WshShell = WScript.CreateObject("WScript.Shell")

strLastUser = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LastUser")
strLastDomain = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LastDomain")
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", strLastUser
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", strLastDomain

Set wshShell = nothing
-------------------------------------------

I would use the first script (getlastlogon.vbs) in the user's logon script (such as the domain logon script) and, since you are logging in locally as Administrator, you can use the second script (setlastlogon.vbs) either manually or in a logoff script for the local administrator.

Everything should then be totally automated.

Hope this helps.

Netelligen
0
 

Author Comment

by:Fubyou
ID: 9672824
The aboce code works great thank you
0
 

Author Comment

by:Fubyou
ID: 9672827
above i meant
0
 
LVL 4

Expert Comment

by:Netelligen
ID: 9673160
Not a problem.

Glad I could help :)
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

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