Solved

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

Posted on 2003-11-01
10
881 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
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
 
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Join & Write a Comment

Suggested Solutions

Let’s list some of the technologies that enable smooth teleworking. 
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

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

16 Experts available now in Live!

Get 1:1 Help Now