randersonda
-
Total Posts
:
4
- Scores: 0
-
Reward points
:
0
- Joined: 11/16/2009
- Location: Jacksonville, FL
-
Status: offline
|
Windows Domain - Clear Default User Name Upon Logoff
Monday, November 16, 2009 6:05 AM
( permalink)
As a domain admin I don't like leaving my username on the logon screen after I'm done working on their computer. I used to manually import a registry value before logging off but that was becoming a pain. The script below will clear out the last logged in user. Add it to a GPO under User Configuration > Windows Settings > Scripts (Logon / Logoff) as a logoff script for automation: Option Explicit
Dim objShell, strRoot
'---Binds the Registry path including Key and Value===---
strRoot = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName"
'---Creates the Shell===---
Set objShell = CreateObject("WScript.Shell")
'---Overwrights the current Default Username with nothing===---
objShell.RegWrite strRoot, "", "REG_SZ"
WScript.Quit
<message edited by randersonda on Monday, November 16, 2009 6:43 AM>
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:Windows Domain - Clear Default User Name Upon Logoff
Monday, November 16, 2009 7:56 AM
( permalink)
Thanks for sharing. As a domain user, I would certainly complain if every user in the company had to retype their user ID everytime they login just so that your user ID won't be on the screen when you log out of a machine.
|
|
|
|
faulkkev
-
Total Posts
:
593
- Scores: 13
-
Reward points
:
0
- Joined: 11/1/2005
- Location: Kansas City, MO
-
Status: offline
|
Re:Windows Domain - Clear Default User Name Upon Logoff
Monday, November 16, 2009 11:12 AM
( permalink)
I think a group policy can do this as well. We do it on our servers are part of our build for security reasons and so you don't have to clear out the last user.
|
|
|
|
randersonda
-
Total Posts
:
4
- Scores: 0
-
Reward points
:
0
- Joined: 11/16/2009
- Location: Jacksonville, FL
-
Status: offline
|
Re:Windows Domain - Clear Default User Name Upon Logoff
Thursday, November 19, 2009 5:55 AM
( permalink)
faulkkev I think a group policy can do this as well. We do it on our servers are part of our build for security reasons and so you don't have to clear out the last user. Yeah, after a quick Google search you're right. I had no idea, although I'm not sure it would have worked for my situation because it is a computer applied policy. I still like to have my user's usernames stay after they log off, I just don't like leaving my name behind.
|
|
|
|