Wednesday, September 12, 2007

How to Set Up a Logon Script Only for Terminal Server Users

The built-in event logging for Terminal Services is lacking if you want to easily know who logged in and when. This is how you can create a log file of everyone that connects to your Terminal Server.

You can use a logon script to dump out the connecting user with the following script in the \windows\system32 directory.

Create a batch file with this line:
echo %username% %clientname% %date% %time% >> C:\TermServLog\logon.log
And enter the name of the batch file into the registry entry as follows:

Run Regedt32.exe and go to the following value: HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion
\Winlogon\Appsetup

After the last entry in the Appsetup value, place a comma and a space and then enter the name and extension of the logon script you placed in the %SystemRoot%\System32 folder. For example, if the value of Appsetup is: Usrlogon.cmd, Rmvlinks.exeAfter adding an entry for Termlogon.cmd, the value would look like: Usrlogon.cmd, Rmvlinks.exe, Termlogon.cmdTermlogon.cmd will now run every time a user logs into the Terminal Server.

How to Set Up a Logon Script Only for Terminal Server Users

2 comments:

  1. Anonymous5:02 AM

    Pretty section of content. I just stumbled upon your site and in accession capital to
    claim that I acquire actually loved account your
    blog posts. Anyway I'll be subscribing in your feeds and even I achievement you get admission to persistently fast.

    Also visit my weblog; logicaudio

    ReplyDelete
  2. Anonymous5:56 AM

    This piece of writing is in fact a pleasant one it assists new the web visitors, who are wishing for blogging.



    Check out my website campania

    ReplyDelete