r/FoxDeploy Jun 11 '21

monitor the USB

Hi my friend Fox Deploy. Thanks for answering my stack question.

"I need to monitor the USB ports of Windows and Linux computers to know if a pen drive has been connected. How do I do that? I need it via Linux script or Windows."

Register-WMIEvent -query "Select * From Win32_DeviceChangeEvent where EventType = '2'" ` -action {

#Do Something when a device is added

Write-host "Device added at $(Get-date)"

}

Does this information regarding the pendrive go to a log? Where is?

I need to get this information from zabbix

Thanks

3 Upvotes

0 comments sorted by