Title: Question: Finding the "owner" Of A Process

I am trying to print out the owner of running process on Windows 2000 Professional ( SP4 ) using WMI, but my call to the "GetOwner" Process defined here - http://msdn.microsoft.com/library/default.asp?url="">, which is part of the Win32_Process Class defined here - http://msdn.microsoft.com/library/default.asp?url=""> .



Here is my code, followed by the error message:


import odbc
import socket
import re
import win32com.client
import win32api
import win32con
import win32file
import pythoncom
import datetime
import os

pythoncom.CoInitialize()
#connect to localhost wmi service
wmi = win32com.client.GetObject('winmgmts://' )
procs = wmi.ExecQuery( "SELECT * FROM WIN32_PROCESS")
user = ""
domain = ""
for proc in procs:
        proc.GetOwner( user, domain )
        print "%s's owner is %s" % ( proc.Name, user   )
x.GetOwner()


Error:
Traceback (most recent call last):
  File "C:\Documents and Settings\John.Gooch\My Documents\File Manager\getowner.py", line 20, in ?
    proc.GetOwner( user, domain )
TypeError: 'int' object is not callable



Any ideas? I tried using the proc.Method('GetOwner') syntax to locate the function, but I don't know how to pass in paramaters ( explained on Microsoft's site ) to the function using that syntax.

Thank You,


John A. Gooch
Systems Administrator
IT - Tools
EchoStar Satellite L.L.C.
9601 S. Meridian Blvd.
Englewood, CO  80112
Desk: 720-514-5708





John A. Gooch
Systems Administrator
IT - Tools
EchoStar Satellite L.L.C.
9601 S. Meridian Blvd.
Englewood, CO  80112
Desk: 720-514-5708

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to