Skip to main content
Version: 8 - Apfelstrudel

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.

note

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. In this case Cloudomation sends the signal to cancel the process on the third party system but as long as the script is running on said system, the execution status will be shown a running in Cloudomation. To cancel the execution you have to kill the process directly in the non-responsive system.

Input Schema

  • host

    The hostname (can be a URL like https://some-url.com or a host alias e.g. localhost) or IP of the remote windows host.

    Type: string

  • username

    The username to use for authentication.

    Type: string

  • password

    The password to use for authentication.

    Type: string

  • transport

    Which transport to use.

    Type: anyOf

  • message_encryption

    If to use message encryption.

    Type: anyOf

  • run_cmd

    A command to execute on the remote windows host. One of run_cmd, run_ps, or run_bat is required.

    Type: anyOf

  • run_cmd_args

    Arguments for the command executed by run_cmd.

    Type: array

  • run_ps

    A powershell script to execute on the remote windows host. One of run_cmd, run_ps, or run_bat is required.

    Type: anyOf

  • run_bat

    A batch script to execute on the remote windows host. One of run_cmd, run_ps, or run_bat is required.

    Type: anyOf

  • cert_pem

    Provide a certificate in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS.

    Type: anyOf

  • cert_key_pem

    Provide a certificate key in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS.

    Type: anyOf

  • encoding

    The character encoding used on the remote host.

    Type: string

    Default: utf-8

  • verify_ssl

    Perform validation of ssl certificates. This can be disabled to use self-signed certificates where the CA certificate is not available.

    Type: boolean

    Default: True

  • server_ca

    Type: anyOf

Output Schema

  • status_code

    The status code of the executed command.

    Type: integer

  • std_out

    The standard output of the executed command.

    Type: string

  • std_err

    The standard error of the executed command.

    Type: string

Constants

ssl_context_inputs = ['check_hostname', 'client_cert', 'client_key', 'server_ca']

Example

import flow_api

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