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
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.
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
echo %username%,-Logon-,%date%,
For the logoff script add:
echo %username%,-Logoff-,%date%
ASKER
how do i create this in gpedit?
Do the following:
Create a file called logon.bat in C:\WINDOWS\System32\GroupP olicy\User \Scripts\L ogon 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\GroupP olicy\User \Scripts\L ogoff 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.
Create a file called logon.bat in C:\WINDOWS\System32\GroupP
echo %username%,-Logon-,%date%,
Create a file called logoff.bat in C:\WINDOWS\System32\GroupP
echo %username%,-Logoff-,%date%
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.
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Log Parser 2.2
http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en