You should be able to use something like this:
     th=win32security.OpenProcessToken(handle,win32security.TOKEN_READ)
     sid=win32security.GetTokenInformation(th,win32security.TokenUser)[0]
     print win32security.LookupAccountSid('',sid)

However, you're going to need to jack up your privileges sky-high or run the script under
the SYSTEM account. Otherwise you'll get an Access Denied for most processes that
aren't yours. Last time I needed to do something like this, I used the Task Scheduler
to run it under the System acct. Running it as a service is another option.


         Roger


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

Reply via email to