Hook for winrm remote execution using pywinrm.

View Source

Last Updated: Apr. 7, 2021

Access Instructions

Install the WinRM provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.


ssh_conn_idstrconnection id from airflow Connections from where all the required parameters can be fetched like username and password. Thought the priority is given to the param passed during init
endpointstrWhen not set, endpoint will be constructed like this: 'http://{remote_host}:{remote_port}/wsman'
remote_hoststrRemote host to connect to. Ignored if endpoint is set.
remote_portintRemote port to connect to. Ignored if endpoint is set.
transportstrtransport type, one of 'plaintext' (default), 'kerberos', 'ssl', 'ntlm', 'credssp'
usernamestrusername to connect to the remote_host
passwordstrpassword of the username to connect to the remote_host
servicestrthe service name, default is HTTP
keytabstrthe path to a keytab file if you are using one
ca_trust_pathstrCertification Authority trust path
cert_pemstrclient authentication certificate file path in PEM format
cert_key_pemstrclient authentication certificate key file path in PEM format
server_cert_validationstrwhether server certificate should be validated on Python versions that support it; one of 'validate' (default), 'ignore'
kerberos_delegationboolif True, TGT is sent to target server to allow multiple hops
read_timeout_secintmaximum seconds to wait before an HTTP connect/read times out (default 30). This value should be slightly higher than operation_timeout_sec, as the server can block at least that long.
operation_timeout_secintmaximum allowed time in seconds for any single wsman HTTP operation (default 20). Note that operation timeouts while receiving output (the only wsman operation that should take any significant time, and where these timeouts are expected) will be silently retried indefinitely.
kerberos_hostname_overridestrthe hostname to use for the kerberos exchange (defaults to the hostname in the endpoint URL)
message_encryptionstrWill encrypt the WinRM messages if set and the transport auth supports message encryption. (Default 'auto')
credssp_disable_tlsv1_2boolWhether to disable TLSv1.2 support and work with older protocols like TLSv1.0, default is False
send_cbtboolWill send the channel bindings over a HTTPS channel (Default: True)


Hook for winrm remote execution using pywinrm.

Was this page helpful?