Link to home
Start Free TrialLog in
Avatar of zenworksb
zenworksb

asked on

terminal services logging

Hello I have a ceo that woudl like to log who is connected to the the terminal server and how long they were one. How do i do this
Avatar of BLipman
BLipman
Flag of United States of America image

You could write a simple program that would parse the event logs.  Just make sure the security log is auditing the events you need and find a log parser.  

Log Parser 2.2
http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en
Avatar of SamuraiCrow
SamuraiCrow

Just a thought...

You could also add a login/logoff script using the gpedit.msc (local computer policy) that runs a batch file with the following syntax:

echo %username%,%date%,%time% >> C:\%username%.txt

This will basically create an entry everytime they log on or off.  It also stores it by username for easy tracking.  I'll test it out and see how it works.
I just tested this and it works.  You probably want the result files to get sent to a hidden report share somewhere.  Just replace the c:\ with \\servername\sharename$\.  One more change I would make for the logon script is:

echo %username%,-Logon-,%date%,%time% >> C:\%username%.txt

For the logoff script add:

echo %username%,-Logoff-,%date%,%time% >> C:\%username%.txt

Avatar of zenworksb

ASKER

how do i create this in gpedit?
Do the following:

Create a file called logon.bat in C:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon with the following (customize for your enviroment) syntax:
echo %username%,-Logon-,%date%,%time% >> C:\%username%.txt

Create a file called logoff.bat in C:\WINDOWS\System32\GroupPolicy\User\Scripts\Logoff with the following (customize for your enviroment) syntax:
echo %username%,-Logoff-,%date%,%time% >> C:\%username%.txt

Open GPEdit.msc and goto:

User Configuration
Windows Settings
Scripts (Logon/Logoff)
Double Click Logon (in the right pane)
Select Add
Select Browse
Select Logon.bat

Do the same steps to add the logoff.bat file to the local policy logoff script.
i did that and it has started logging. a couple of questions. I would like to run a report that will input this all into a spread sheet for teh ceo to read, and also does this info continue to append or everytime a person logs oon and off will it just overwrite? thank tyou so much
ASKER CERTIFIED SOLUTION
Avatar of SamuraiCrow
SamuraiCrow

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial