Page 1 of 1

[REQUEST] Create a log file when a USER insert a usb

Posted: 08 Feb 2018 01:19
by MeSH
Good day to all DosTips admin, staff and members here...

I would like to request a script when a user insert a usb the script will log it. These are the info inside a log file:

<date created>: USB Connected/Disconnected: <computer name>: <time inserted/eject>

Example:

Code: Select all

02-08-2018: USB Connected: PC01: 10:00:00
02-08-2018: USB Disconnected: PC01: 10:05:00
02-08-2018: USB Connected: PC05: 12:00:00
02-08-2018: USB Disconnected: PC05: 13:00:00
02-08-2018: USB Connected: PC16: 14:30:00
02-08-2018: USB Disconnected: PC16: 14:35:00
Note:
it's up to you if it's in 12 or 24 hour format.
It will not create a new log file, it will only update it (if it's possible).

Specification can run also in windows xp and above

is this possible using a script? I requesting this script because I can't find in the internet that fits on our system...
I found USBLog view but when I run it it won't create a log file... I will apply this on my work since we are dealing a students and our CCTV is not enough... we have many blind spots... so I decided to go back here in DosTips to ask for help again. Thanks

UPDATE:
the log file can save on a remote computer so we can isolate it. just tell me where in the part of the code to edit it... thanks again :-)

Re: [REQUEST] Create a log file when a USER insert a usb

Posted: 08 Feb 2018 11:00
by Squashman
I can think of two ways to do this.

1) Create a Windows Schedule task that triggers for the specific event that happens when a USB device is inserted into the computer.

2) Use Microsoft's Log Parser to read the system logs for that specific event.

Happy Researching.

Re: [REQUEST] Create a log file when a USER insert a usb

Posted: 08 Feb 2018 19:50
by MeSH
Good day! I installed microsoft parser but its only applicable to windows 7 and up... our computers here are mixed with windows xp & 7... So I decided to post here if ever someone can create a script for it so it can run any version of windows os v :-)

Re: [REQUEST] Create a log file when a USER insert a usb

Posted: 08 Feb 2018 21:55
by ShadowThief
XP stopped being supported two years ago; come into the 21st century already.

Re: [REQUEST] Create a log file when a USER insert a usb

Posted: 09 Feb 2018 04:26
by penpen
The Log Parser should be still available for Win XP professional edition:
https://www.microsoft.com/en-us/downloa ... x?id=24659.

penpen

Re: [REQUEST] Create a log file when a USER insert a usb

Posted: 09 Feb 2018 18:07
by MeSH
ShadowThief wrote:
08 Feb 2018 21:55
XP stopped being supported two years ago; come into the 21st century already.
I don't have a choice since I am working in a government... it's hard to request a brand new PC's it takes half or years just to approve a request...

Re: [REQUEST] Create a log file when a USER insert a usb

Posted: 09 Feb 2018 19:28
by MeSH
penpen wrote:
09 Feb 2018 04:26
The Log Parser should be still available for Win XP professional edition:
https://www.microsoft.com/en-us/downloa ... x?id=24659.

penpen
thanks :-)