You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frompypsexec.clientimportClienthost="win-host.domain1.lco"user="[email protected]"passw="SecretPassword"username_gmsa="GMSA_LOGIN$"working_directory="C:\\"c=Client(host, username=user, password=passw)
command="echo Hello World"c.connect()
try:
c.create_service()
stdout, stderr, rc=c.run_executable("cmd.exe",
arguments="/c "+command, username=username_gmsa, use_system_account=True, working_dir=working_directory)
finally:
c.remove_service()
c.disconnect() ```
process_username=module.params['process_username']
process_password=module.params['process_password']
use_system_account=module.params.get('use_system_account', False) # or something more appropriateuse_system=Falseifprocess_usernameisnotNoneanduse_system_account==True:
use_system=True# this works for me when I use special GMSA accounts to run commands on windows using cmd or powershellprocess_username=process_username##process_password=None
The text was updated successfully, but these errors were encountered:
The underlying Python library used by the psexec module uses the PAExec executable on the service side which does not support gMSA accounts the last time I checked.
Can you add a new use_system_account parameter and new rules to run a special account on a remote windows machine?
community.windows/plugins/modules/psexec.py
Line 394 in e0e5255
The text was updated successfully, but these errors were encountered: