Is there any way to read Windows Event Log with PHP?
To be specific, I want to read windows users' logon & logoff activities with corresponding user names. I am using PHP with wamp server.
I couldn't find a way to read Window's Event Log directly. But in my case I wanted have Logon & Logoff info. So I manage that in another way.
wrote two .bat files as follows.
LogOn.bat; Which includes the following code.
echo Login %Date% %TIME% %USERNAME% >> {Directory path to log folder}\%Date%.txt
LogOff.bat; which includes the following code.
echo LogOff %Date% %TIME% %USERNAME% >> {Directory path to log folder}\%Date%.txt
Then added these files to logon & logoff scripts. Bellow are the steps.
Note; This will log, logon & logoff information into a file name with Day. You can change the file name as your preference.
At the end I could read the logged text files via PHP. Hope this helps to someone.