I am having problems trying to audit a third party app with a SQLServer backend.
The app manages users and user access via a SQL table, using a single SQL login to access the databases.
I am trying to audit this by using the Host PID much like Windows Task Manager associates a PID and Owner for every process.
Here is what I have attempted and tried
- I was able to figure out how to extract the
app.exe
PID. - I cannot figure out how to get the Windows Owner associated to that PID.
- I have tried using
xp_cmdshell
to query the Windows tasklist and even wrote a .Net console app which gets called by SQL to collect the information but every time I try to extract the Owner it is blank.
Any thoughts on how I can get the Owner?
Best Answer
You can get the owner using PowerShell:
script source