I am trying to impersonate a user in python and call the CMD command:
login('secondUser','123')
os.system("some CMD command ")
logout()
where logging in and logging out are functions that are used win32apito impersonate the user.
The problem is that it os.systemdoes not execute the command as an impersonated user ( secondUser), it executes the command when the user logs on to the system.
I am using windows7 64x and python 2.7
Is there a way to invoke a command CMDwith an impersonated user?
source
share