[python-win32] Re: Is there a Python win32 RunAs equivalent where youcan send a password?

R. Alan Monroe amonroe at columbus.rr.com
Thu Mar 18 14:18:12 EST 2004



> the print win32api.GetUserName() prints the impersonated user's name
> like I expect, but the notepad process is running as _me_, not the
> impersonated user (@&$#^@$!!!). Am I doing something wrong?

> I briefly toyed with win32process.CreateProcessAsUser, but that put me
> back at square one with the error about not having a required
> privilege.

I'm getting closer - putting myself in the "Replace a process level
token" policy allows me to launch processes with CreateProcessAsUser,
and they genuinely run as the intended impersonated user... BUT, the
spawned process invariably bombs out immediately with "the application
failed to initialize properly (0xc0000142) click on ok to terminate
the application". Any ideas?

Alan




More information about the Python-win32 mailing list