Skip to content
  • Home
  • Categories
    • Workstation
      • Laptop
      • Desktop
    • Information
    • Troubleshooting
    • Operating Systems
      • Windows
    • Guides
    • Fixes
    • Security
    • Backup
    • Scripting
    • Data Recovery
    • Facebook
    • Avaya
  • All The Legal
    • Disclaimer
    • Privacy Policy
Techtips.co.za
  • Home
  • Categories
    • Workstation
      • Laptop
      • Desktop
    • Information
    • Troubleshooting
    • Operating Systems
      • Windows
    • Guides
    • Fixes
    • Security
    • Backup
    • Scripting
    • Data Recovery
    • Facebook
    • Avaya
  • All The Legal
    • Disclaimer
    • Privacy Policy
  • Home
  • / Enterprise Services /
  • Log Off
  • /
  • Logon
  • /
  • Audit users with a batch file
Enterprise Services . Log Off . Logon

Audit users with a batch file

On May 13, 2018 by TechTips

Audit users Logon/logoff as well as Startup/Shutdown with batch file

Here are four simple Batch files you can use to audit your users logon/logoff as well as startup/shutdown activity. to install simply create the following four batch files. you can either use the startup folder in windows if you dont use Active Directory or I would suggest using Logon/Logoff shutdown/startup scripts in Group Policy.

Login.bat

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

echo %username% logged ON %computername%, IP=%IP% @ %time% %date% >> \serveraudits$users%username%.txt

Logoff.bat

echo %username% logged OFF %computername% @ %time% %date% >> \vtjnbdc02audits$users%username%.txt

Startup.bat

for /f “Tokens=2 Delims=[]” %%i in (‘ping -n 1 “%computername%”‘) do set IP=%%i
echo Started up, IP=%IP% @ %time% %date% >> \serveraudits$computers%computername%.txt

Shutdown.bat

echo Shutdown @ %time% %date% >> \vtjnbdc02audits$computers%computername%.txt

Tags: Audit, batch file, Logon/logoff, Startup/Shutdown
  • 3G
  • Adobe Acrobat
  • Apple
  • Avaya
  • Backup
  • Backup
  • BES Server
  • Bitlocker
  • Blackberry
  • Cisco
  • Control Guard
  • ControlGuard
  • Data Recovery
  • Desktop
  • Document Template
  • Documents
  • Email Template
  • Enterprise Services
  • Exchange
  • Facebook
  • Fixes
  • FoxIT
  • General
  • Google+
  • Guides
  • Hardware
  • Headset
  • Helpdesk
  • Home Assistant
  • Home Automation
  • IIS7
  • Information
  • Java
  • KeyLogger
  • Laptop
  • Log Off
  • Logon
  • Mobile
  • Mobile / 3G
  • Multifunction Printers
  • Networks
  • Objectives and KPI's
  • Operating Systems
  • OSX
  • Outlook 2007
  • Outlook 2010
  • PGP Encryption
  • Phishing
  • Port/Device Control
  • Powershell
  • Printers & Imaging
  • Robocopy
  • RSA Security Console
  • Scripting
  • Security
  • Social Media
  • Software
  • Spiceworks
  • Support Apps
  • Teamviewer
  • Teamviewer
  • Troubleshooting
  • Twitter
  • Two-Step Verification
  • Virtualization
  • VoIP
  • VPN
  • Web and Internet
  • Windows
  • WordPress
  • Workstation
  • XAMPP – Apache

address automatic complete Avaya Backup basic Blackberry Blackberry Enterprise Server CCNA cisco commands config configuration Desktop Support email Email Signature Email Template Error Exchange Facebook Factory Defaults feature file Fix How to KPI Laptop Microsoft Office Outlook 2007 Microsoft Outlook Outlook Outlook 2007 Outlook 2010 password security Phishing Phishing Scams router S.M.A.R.T Security start Startup/Shutdown Template Tips troubleshooting windows Windows 7 Windows XP