Saturday, July 2, 2022

How to track users logon/logoff using a script

- Advertisment -

How to track users logon/logoff

The Auditing(Option 1)

1. Enable Auditing on the domain level by using Group Policy:
2. Go to Computer Configuration / Windows Settings/ Security Settings/Local Policies / Audit Policy
3. There are two types of auditing that address logging on, they are Audit Logon Events and Audit Account Logon Events.
4. Audit “logon events” records logins to the PC(s) targeted by the policy and the results appear in the Security Log on that PC(s).
5. Audit “Account Logon” Events tracks logons to the domain,and the results appear in the Security Log on domain controllers only.
How to track users logon/logoff using a script
How to track users logon/logoff using a script

Option 2

  1. Crete a logon script on the required domain/OU/user account with the following content:
    echo %date% , %time%, %computername%, %username% , %sessionname%, %logonserver% > > \\SERVER\SHARENAME$\LOGOFF.LOG

2. Create a logoff script on the required domain/OU/user account with the following content:

echo %date% , %time%, %computername%, %username% , %sessionname%, %logonserver% > > \\SERVERSHARENAME$LOGOFF.LOG

NOTE : Please be aware that unauthorized users can change the scripts, due to the requirement that the SHARENAME$ will be writeable by users.

Option 3:

Use WMI/ ADSI to query each domain controller for logon/logoff events.
- Advertisment -

Popular

- Advertisement -



Latest

Related news

YouTube Videos On Apple Watch

Now Enjoy YouTube Videos On Apple Watch

0
This is the great and the latest news for the Apple users who have iWatch....

Elden Ring: 12 Hidden Facts You Probably Did Not Notice

0
Even if you have completed Elden Ring and have already begun New Game+, it's likely...
Overwatch 2 beta

How To Get Overwatch 2 Beta Right Now

0
In this article we have explained how can you get your hands on the most...
Upgrade From Google Hangouts To Google Chat

Upgrade From Google Hangouts To Google Chat

0
Google recently that is in October 2020 announced that Google Chat is going to be...
Apple Watch Not Tracking Activity

Apple Watch Not Tracking Activity (2022): Fixed

0
To fix your Apple Watch not accurately monitoring activity or counting steps, simply follow the...
- Advertisement -

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.