So I'm making a Watchdog script (based on this: https://www.thepythoncorner.com/2019/01/how-to-create-a-watchdog-in-python-to-look-for-filesystem-changes/) that detects changes in a Windows Explorer directory. If a file is created, deleted, moved, and modified and records the following: Who, When, What.
I have everything down except the who part. The folder I want to keep track of is a network drive where multiple people will be changing stuff around on it and I want to see who is messing it up.
My attempt:
#Get username
import getpass
user = getpass.getuser()
Actual Outcome: Me (program user)
Expected Outcome: The people affecting the files.
I am limited in the tool I can use, I have to use Python. No event viewer/logger or server information.
Thank you.