How to get Process Owner by Python using WMI?
问题 I tried to get some information about Process Owner, using WMI. I tried to run this script: import win32com.client process_wmi = set() strComputer = "." objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2") process_list = objSWbemServices.ExecQuery("Select * from Win32_Process") for process in process: owner = process.GetOwner if owner != 0: print('Access denied') else: print('process: ',process.Name,