Solved

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

Posted on 2003-11-01
10
883 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
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.

 
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

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.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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…

821 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