Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-11-01
10
Medium Priority
?
890 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
Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

 
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 1000 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

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

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

During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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…

636 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