ConnectorTypePS
class connector_types.connector_type_ps.ConnectorTypePS
Access a Windows Remote Management (WinRM) service.
This connector type enables you to interact with a Windows Remote Management (WinRM) service. See Windows Remote Management for information about WinRM.
For modes "run_batch_script" and "run_powershell_script" execution is resilient to conenction disruptions between the workspace and the Windows system: the script runs as a scheduled task on the host, so when the connection to Cloudomation is lost and re-established (network glitch, workspace restart, ...) the connector reattaches to the still-running task and reports its real result.
The "run_powershell_commands" and "run_batch_commands" modes run the script directly on the host (synchronously, without a scheduled task) — mirroring the SSH connector's "run commands". They are faster for short scripts (a single WinRM round-trip, no scheduled-task registration or CIM module load) but are not reattachable: a lost connection ends the execution instead of leaving the work running to be reconnected. Use the "_script" scheduled-task modes for long-running or detached jobs that must survive a connection loss, and the "_commands" direct modes for short synchronous work where speed matters.
"execute_command" runs a single command synchronously and cannot be reattached; a lost connection cancels it unless it is marked idempotent=True (safe to re-run from the start), in which case it is re-run. A genuine user cancel always terminates the remote work.
The scheduled task's run-credential is controlled by logon_type (default
"password"): the connection password is stored as the task credential so
the task can access network resources. Set logon_type="s4u" to register the
task without sending the password to the host at all (no secret on the remote
command line or in Windows event logs) — at the cost of the task no longer
being able to access network resources.
While a script connection is running, partial updates are merged into the execution
output_value as std_out and std_err (see live_output and
live_output_poll_interval). Applies to run_powershell_script and run_batch_script.
Set live_output=False to disable. Poll interval minimum is 1 second.
Cancelling an active execution created by a PS connector might not be possible if the third party system, that is running the script, doesn't respond.
Input Schema
-
schema_version = '2026-07-07'Type:
string -
authenticationType:
anyOfOptions: -
schemeThe scheme to use.
httpsconnections are encrypted with TLS/SSL and expose the TLS options.Type:
anyOfOptions: -
hostThe remote hostname or IP address.
Type:
string -
portType:
anyOfOptions: -
pathThe path of the WinRM server.
Type:
stringDefault:
/wsman -
transportWhich transport to use.
Type:
anyOfOptions: -
message_encryptionIf to use message encryption.
Type:
anyOfOptions: -
modeType:
anyOfOptions: -
encodingThe encoding to use when binary data is returned by the server.
Type:
stringDefault:
utf-8 -
logon_typeHow the resilient scheduled task (run_powershell_script / run_batch_script modes) authenticates on the Windows host.
Type:
anyOfOptions: -
script_timeoutMaximum wait for batch or PowerShell script completion, in seconds. Use no limit to wait until the script finishes.
Type:
anyOfOptions: -
live_outputStream partial output_value updates (std_out, std_err) while a script is running.
Type:
booleanDefault:
True -
live_output_poll_intervalHow often to poll remote stdout and stderr log files for live output updates, in seconds.
Type:
integerDefault:
1 -
idempotentWhether re-running this connection from the start is safe (no duplicate side effects). Controls recovery after the connection between Cloudomation and the remote system is lost and later re-established (network glitch, workspace restart, ...): repeatable connections are left running to be reattached or re-run, others are cancelled. Leave unset to let the connector decide based on the operation.
Output Schema
Constants
supports_reconnect = FalseExample
Execute a command using NTLM authentication
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
this.connect(
connector_type='PS',
authentication={
'authentication_method': 'username_password',
'username': '...',
'password': '...',
},
scheme={'scheme': 'http'},
host='...',
port={
'port_mode': 'service_name',
'service_name': 'wsman',
},
transport='ntlm',
mode={
'mode_name': 'execute_command',
'command': 'ipconfig',
'args': ['/all'],
},
encoding='windows-1252',
)
Run a Powershell script using certificate authentication
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
this.connect(
connector_type='PS',
authentication={
'authentication_method': 'username_password',
'username': '...',
'password': '...',
},
scheme={
'scheme': 'https',
'verify_ssl': True,
'server_ca': '...',
'check_hostname': True,
'client_cert': '...',
'client_key': '...',
},
host='...',
port=5986,
path='/wsman',
transport='ssl',
message_encryption='always',
mode={
'mode_name': 'run_powershell_script',
'script': 'Write-Host "Hello World!"',
},
)
return this.success('all done')