Windows Domain - Clear Default User Name Upon Logoff

Author Message
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)
0
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>
 
#1
    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)
    0
    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.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      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)
      0
      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.
       
      #3
        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)
        0
        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.
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9