Solved

report of login and logout of computer

Posted on 2011-03-02
5
311 Views
Last Modified: 2012-06-22
hello expoerts i need to find the way
to know the first time that user login into their computer and when they log out.
the main idea of this is know at waht time the user star using his computer in the morning.


thanks guys
0
Comment
Question by:nickt25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Noduzz
ID: 35022170
My best recommendation is to create a login script to that logs that info either in a database remotely or log file on the machine or remote server.
0
 
LVL 5

Accepted Solution

by:
Noduzz earned 500 total points
ID: 35022207
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35022215
I use the following two .bat

The first one is the logon script and the second is the logoff.

This creates a running excel spreadsheet that you can go back to anytime and view when users have logged on or off
@echo off
echo %username%,,%computername%,,%date%,, %time%,,logged off>>\\server1\logs$\logoffs.csv


ENDLOCAL

Open in new window

@echo off

set loc=
set GW=
Rem Determine whether the session is a local logon or a RDP session

netstat -an |find "3389" |find /I "established" >C:\Result1.txt
For /F "tokens=3 delims= " %%A IN (C:\Result1.txt) DO SET loc=%%A
if (%loc%)==() set loc=console



REM you could use this next routine to determine the subnet(Branch office location) by grabbing the default gateway
Rem You can modify GW= to fit your environment
Rem Modify IP's below to match your subnet gateways

for /f "tokens=2 delims=:" %%a in ('ipconfig ^| find "Gateway"') DO SET GW=%%a
if %GW%== 10.63.106.2 set GW=Branch1    
if %GW%== 10.63.106.130 set GW=Branch2
if %GW%== 10.63.106.162 set GW=Branch3
if %GW%== 10.63.106.194 set GW=Branch4
if %GW%== 10.63.106.226 set GW=Branch5
if %GW%== 10.63.107.2 set GW=Branch6  
if %GW%== 10.63.107.34 set GW=Branch7
if %GW%== 10.63.107.66 set GW=Branch8
if %GW%== 10.63.107.98 set GW=Branch9
if %GW%== 10.63.107.130 set GW=Branch10
if %GW%== 10.63.107.162 set GW=Branch11
if %GW%== 10.63.107.194 set GW=Branch12   

REM this grabs the computer ip address


for /f "Tokens=2 Delims=[]" %%i in ('ping -n 1 "%computername%"') do set IP=%%i

Rem used double commas for readability
echo %username%,,%computername%,,%IP%,,%GW%,,%Loc%,,%Date:~0,16%,,%Time:~0,5%,,"logged on" >>\\server1\logs$\logins.csv 


ENDLOCAL

Open in new window

0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35022225
The second one is the logon script (they got switched around when I posted)
0
 
LVL 3

Author Closing Comment

by:nickt25
ID: 35732700
tks :)
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Serverā€¦
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlleā€¦
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question