Skip to main content

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.

Inputs

NameTypeDefaultDescription
cert_key_pemstrNoneProvide a certificate key in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS
cert_pemstrNoneProvide a certificate in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS
hoststrThe hostname or IP of the remote windows host
message_encryptionstrautoIf to use message encryption. See Encryption
passwordstrThe password to use for authentication
run_cmdstrNoneThe command to execute on the remote windows host
run_cmd_argslistNoneArguments for the command executed by run_cmd
run_psstrNoneThe powershell script to execute on the remote windows host
transportstrsslWhich transport to use. See Valid transport options
usernamestrThe username to use for authentication

Outputs

NameTypeDefaultDescription
execution_idintThe ID of the connection execution
messagestrThe ended message for the connection. If the connection ended with an error, the message will contain information about what went wrong
statusstrThe ended status for the connection. Either "success" or "error".
status_codeintThe status code of the executed command
std_errstrThe standard error of the executed command
std_outstrThe standard output of the executed command

Constants

input_list = ['cert_key_pem', 'cert_pem', 'host', 'message_encryption', 'password', 'run_cmd', 'run_cmd_args', 'run_ps', 'transport', 'username']output_list = ['status_code', 'std_err', 'std_out']version = 1

Methods

Example

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
this.connect(
connector_type='PS',
host='my-windows-host',
username='kevin',
password='secret',
run_cmd='ipconfig',
)
this.connect(
connector_type='PS',
host='my-windows-host',
username='kevin',
password='secret',
run_ps='Write-Host "Hello World!"',
)
return this.success('all done')