PowerShell Adapter
Executes PowerShell scripts and returns the results.
Remarks
The PowerShell BizTalk Adapter is a BizTalk Server transmit adapter that will execute PowerShell scripts whenever BizTalk sends a message through it. This allows for easy creation of custom processing scripts for BizTalk messages that are completely integrated into your BizTalk solution.
Setting up the Adapter
To use the PowerShell BizTalk Adapter, it's necessary to do the following:
- Create a new Send Port in your BizTalk application
- Select the PowerShell BizTalk Adapter as the adapter to use in the port
- Configure the Adapter settings with the following:
- A name that identifies this send port
- The PowerShell script to execute when a message is sent; this can be the script itself or the dot-source for an external script file
- Optionally, to pass additional input data to the script, fill in the Variables property; this should be a list of 'name=value' pairs, one per line, and each one will be visible in the PowerShell script as a variable called $name
Accessing the BizTalk Message
Detailed information about accessing BizTalk message properties can be found under the Script property.
Diagnosing Scripts
The Adapter provides an easy way for scripts to generate diagnostics data that can be used to troubleshoot their behavior, by providing ways for the scripts to write diagnostic messages directly to the Adapter log.
This is exposed to the script through the Write-Debug, Write-Warning and Write-Verbose cmdlets, or as an alternative, by calling the corresponding functions in $host.UI.
Executing Scripts on Remote Machines
Detailed information on remote execution can be found under the Host property.
Sender Property List
The following is the full list of the properties of the sender Adapter with short descriptions. Click on the links for further details.
Firewall | A set of properties related to firewall access. |
Host | The host where the command should be executed. |
MaxThreads | The maximum number of threads that the component may consume. |
MaxTransmissionBatchSize | The maximum number of messages that can be sent in a single batch. |
Other | Defines a set of configuration settings to be used by the component. |
Password | The password to use when executing commands remotely. |
Port | The TCP port number to use for remote connections. |
PortName | A unique name assigned to this send port. |
Protocol | The protocol to use for executing remote commands. |
Script | The PowerShell script to execute. |
SSHAcceptServerHostKey | Instructs the component to accept the server host key that matches the supplied key. |
SSHAuthMode | The type of authentication used by the component. |
SSHCert | The certificate to use for client authentication during the SSH handshake. |
SSHCompressionAlgorithms | A comma-separated list of compression algorithms allowed for this connection. |
Timeout | A timeout for the component. |
TransmitBatchMode | How the transmitter processes batches. |
TransportLog | Tells the component where and how to report information about its operations. |
URI | The Uniform Resource Identifier (URI) of the send port or receive location. |
User | The username to use when executing commands remotely. |
Variables | Variables to add to the PowerShell Runspace before executing the command. |
Config Settings
The following is a list of config settings for the Adapter with short descriptions. Click on the links for further details.
KeyRenegotiationThreshold | Sets the threshold for the SSH Key Renegotiation. |
LogSSHPackets | If True, detailed SSH packet logging is performed. |
ReportScriptError | Whether script errors cause a failure. |
SSHAcceptServerHostKeyFingerPrint | Instructs the component to accept the server's host key with this fingerprint. |
SSHEncryptionAlgorithms | A comma-separated list containing all allowable compression algorithms. |
SSHKeyExchangeAlgorithms | Specifies the supported key exchange algorithms. |
SSHMacAlgorithms | Specifies the supported Mac algorithms. |
SSHPublicKeyAlgorithms | Specifies the supported public key algorithms for the server's public key. |
UseStrictKeyExchange | Specifies how strict key exchange is supported. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
TcpNoDelay | Whether or not to delay when sending packets. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |
PowerShell Transmitter
Setting the PowerShell Adapter Configuration Properties for a Dynamic Send Port
A dynamic send port does not provide any transport configuration options in BizTalk Explorer because it is expected that these properties will be provided with the context properties associated with the message. These properties can be set in a custom pipeline or in an orchestration. To set message configuration properties in an orchestration you can do the following:
- Add a Construct Message shape to your orchestration.
- Configure the Construct Message shape to construct a new message. (for example Message_2)
- Add a Message Assignment shape to the Construct Message shape.
- Add code to the Message Assignment shape to initialize the message that you constructed and to set the appropriate configuration properties for the message.
Configuring the PowerShell Send Port with the BizTalk Server Administration Console
To configure the send port by using the BizTalk Server Administration console, use the following procedure:
To configure variables for a PowerShell send port:
- In the BizTalk Server Administration console, create a new send port or double-click an existing send port to modify it. For more information, see How to Create a Send Port. Configure all of the send port options and specify nsoftware.PowerShell 2022 for the Type option in the Transport section of the General tab.
- On the General tab, in the Transport section, click the Configure button next to Type.
- In the nsoftware.PowerShell 2022 Transport Properties dialog box, use the following properties to:
Firewall A set of properties related to firewall access.
Type: Firewall Default Value: nullHost The host where the command should be executed.
Type: xs:string Default Value: ""MaxThreads The maximum number of threads that the component may consume.
Type: xs:int Default Value: 20MaxTransmissionBatchSize The maximum number of messages that can be sent in a single batch.
Type: xs:int Default Value: 1Other Defines a set of configuration settings to be used by the component.
Type: xs:string Default Value: ""Password The password to use when executing commands remotely.
Type: baf:Password Default Value: ""Port The TCP port number to use for remote connections.
Type: xs:int Default Value: 22PortName A unique name assigned to this send port.
Type: xs:string Default Value: ""Protocol The protocol to use for executing remote commands.
Type: xs:int Default Value: 0Script The PowerShell script to execute.
Type: xs:string Default Value: ""SSHAcceptServerHostKey Instructs the component to accept the server host key that matches the supplied key.
Type: Certificate Default Value: nullSSHAuthMode The type of authentication used by the component.
Type: xs:int Default Value: 2SSHCert The certificate to use for client authentication during the SSH handshake.
Type: Certificate Default Value: null
NOTE: The digital id must have a private key associated with it.SSHCompressionAlgorithms A comma-separated list of compression algorithms allowed for this connection.
Type: xs:string Default Value: "none"Timeout A timeout for the component.
Type: xs:int Default Value: 60TransmitBatchMode How the transmitter processes batches.
Type: xs:int Default Value: 0TransportLog Tells the component where and how to report information about its operations.
Type: Log Default Value: nullURI The Uniform Resource Identifier (URI) of the send port or receive location.
Type: xs:string Default Value: ""User The username to use when executing commands remotely.
Type: xs:string Default Value: ""Variables Variables to add to the PowerShell Runspace before executing the command.
Type: xs:string Default Value: "" - Click OK and OK again to save settings.
ErrorThreshold Property (PowerShell Adapter)
The maximum number of errors before the component shuts down.
Data Type
Integer
Default Value
5
Remarks
This property limits the number of errors that the adapter can incur before it shuts down and stops processing messages.
If set to 0 the adapter will never shutdown.
Note that if the operation completes successfully the current error count will be reset.
This property may be configured on the adapter's static handler property page in the BizTalk Server administration console.
This property is not available in the Sender.
Firewall Property (PowerShell Adapter)
A set of properties related to firewall access.
Data Type
FirewallRemarks
This is a Firewall type property which contains fields describing the firewall through which the adapter will attempt to connect.
Host Property (PowerShell Adapter)
The host where the command should be executed.
Data Type
String
Default Value
""
Remarks
If a value for the Host property is specified, the adapter will try to execute commands remotely using the protocol specified by the Protocol property.
To use PowerShell Remoting, set the following options in the adapter properties:
- Host: The name or IP address of the remote computer
- Protocol: set to Remoting (0)
- User and Password: Optional; if not specified, the connection will be attempted using the user the adapter is running under
To use PowerShell Server, PowerShell Server must be installed and running in the remote machine, and it should be configured with the following properties:
- Host: The name or IP address of the remote computer
- Protocol: set to SSH (1)
- SSHAuthMode: Set to amPassword for username/password authentication or to amPublicKey for public key authentication. For the latter, this option needs to have been enabled in the remote PowerShell Server, and the task needs to have access to a certificate the server will accept
- User: The username to be used for authentication
- Password: Optional; the host key/certificate used to authenticate the server
- SSHCert: The certificate to use for public key authentication
Scripts executed remotely don't have access to input or output message variables or variables set through the PSVariables property.
MaxThreads Property (PowerShell Adapter)
The maximum number of threads that the component may consume.
Data Type
Integer
Default Value
20
Remarks
This property limits the number of concurrent threads that the adapter may consume while completing its work.
This property can only be configured through the adapter's static handler property page in the BizTalk Server administration console.
MaxTransmissionBatchSize Property (PowerShell Adapter)
The maximum number of messages that can be sent in a single batch.
Data Type
Integer
Default Value
1
Remarks
This property controls the maximum size of an outbound message batch.
Note: be careful when modifying this property as it directly effects the efficiency of the transmit adapter. Setting MaxTransmissionBatchSize to a low value in an environment that requires transmission of large quantities of data will result in the adapter accumulating several small batches. If TransmitBatchMode is set to Parallel, this will result in the adapter transmitting many small batches at once and can put a heavy load on the processor.
Conversely, if TransmitBatchMode is set to Serial, setting MaxTransmissionBatchSize to a large value may result in long transmission delays as the adapter will wait on existing work to complete before accepting new messages from the BizTalk Message Engine. This is especially true when the adapter is transmitting large data.
This property can only be configured through the adapter's static handler property page in the BizTalk Server administration console.
This property is not available in the Receiver.
Other Property (PowerShell Adapter)
Defines a set of configuration settings to be used by the component.
Data Type
String
Default Value
""
Remarks
The adapter accepts one or more configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the adapter, access to these internal properties is provided through the Other property.
The Other property may be set to one or more configuration settings (name/value pairs). Set one setting per line.
For example:
configname1=value1
configname2=value2
Password Property (PowerShell Adapter)
The password to use when executing commands remotely.
Data Type
Password
Default Value
""
Remarks
Specifies the password for authenticating when executing commands remotely.
Port Property (PowerShell Adapter)
The TCP port number to use for remote connections.
Data Type
Integer
Default Value
22
Remarks
The Port property is used together with Host when opening connections to execute commands against remote PowerShell SSH servers.
PortName Property (PowerShell Adapter)
A unique name assigned to this send port.
Data Type
String
Default Value
""
Remarks
This is just a name to identify this send port with a unique identifier
Protocol Property (PowerShell Adapter)
The protocol to use for executing remote commands.
Data Type
Enumeration
Possible Values
Remoting (0)
SSH (1)
Default Value
0
Remarks
Normally, the adapter will execute commands on a local PowerShell runspace. If the Host property is set, the adapter will attempt to connect to the remote host using the protocol specified on the Protocol property.
Remoting (default) | Use PowerShell V2 Remoting (WinRM). |
SSH | Connect to a PowerShell SSH Server over the SSH protocol. |
Script Property (PowerShell Adapter)
The PowerShell script to execute.
Data Type
String
Default Value
""
Remarks
A set of PowerShell expressions to execute when a message is sent through the adapter. This can be the script itself, or the dot-source for an external script file.
Accessing the BizTalk message inside the script
The BizTalk message being sent is made available within the script through the $message variable. This is a wrapper object around the real BizTalk message that makes it easier to use from PowerShell. The $message object has the following properties and methods:
- GetBody(): This method returns the BizTalk message body as a string.
- GetBodyB(): This method returns the BizTalk message body as a byte array.
- MessageID: This property can be used to get the unique ID assigned to this BizTalk Message.
- BodyPartName: This property will return the name of the body part of the message.
- GetProperty(): This method takes the name and namespace of a context property and returns its value.
- ReadBodyPart(): This method will return a System.IO.Stream object associated with the message Body Part.
- ReadPart(): This method takes the name of a specific part in the message and returns its data Stream.
- GetPartNames(): This method will return a list of the names of all parts available in the message.
Here is an example of a script that will read the request message content as XML and write it to a file named for its contents:
$xml = [xml] $message.GetBody()
# xml looks like: "<order><orderId>123422</orderId>....</order>"
$name = $xml.order.orderId
$xml.get_OuterXml() | set-content "C:\orders\$name.xml"
If the Adapter is used in a two-way, solicit/response send port, the data can be passed back to the BizTalk Application through the response message. The body data stream of the response message is created automatically in the following way:
- It's possible to write directly to the response stream using the Write-Host cmdlet or by directly calling the Write() and WriteLine() methods in $host.UI.
- Objects written through Write-Output or returned by the script are fed through the default output formatter in PowerShell and written as text to the response stream.
The script can also interact directly with the response message through the $replyMessage variable. This object has the same methods/properties as the request message object mentioned before, and also adds:
- AddPart(): This method adds a new, non-body, part to the BizTalk message. It takes as arguments the name of the part (must be unique) and a Stream object with the data.
- SetProperty(): This method writes a property to the message context. It takes the name, namespace and value of the property.
- Promote(): This method promoted a property in the message context. It takes the name, namespace and value of the property.
SSHAcceptServerHostKey Property (PowerShell Adapter)
Instructs the component to accept the server host key that matches the supplied key.
Data Type
CertificateRemarks
If the host key that will be used by the server is known in advance, this property may be set to accept the expected key. If you are using the fingerprint, you may supply it to the SSHAcceptServerHostKeyFingerPrint setting by HEX encoding the values in the form "0a:1b:2c:3d". If this property is not set the server will not be authenticated, and the connection will be refused by the client.
Note: You may also set the Accept Any field to Yes without opening the certificate selection dialog to force the adapter to unilaterally authenticate any server during the security handshake. It is strongly recommended that you use this only for testing purposes. Set the LogMode to Info to cause the adapter to report the server's credentials to Location.
SSHAuthMode Property (PowerShell Adapter)
The type of authentication used by the component.
Data Type
Enumeration
Possible Values
None (0)
Multi Factor (1)
Password (2)
Public Key (3)
Keyboard Interactive (4)
GSSAPIWith Mic (5)
Default Value
2
Remarks
SSHAuthMode controls how the adapter attempts to authenticate when connecting to the SSHHost. The following authentication methods are available:
None | The adapter will attempt anonymous authentication. |
Multi-Factor | The adapter will attempt as many authentication steps as the server requires using whatever credentials it has available. |
Password | The adapter will send the SSHPassword to the server. |
Public Key | The adapter will send the SSHCert to the server; |
Keyboard-Interactive | The adapter will perform SSH keyboard-interactive authentication, responding automatically to the server's authentication prompts. It will supply the value of SSHPassword as the response to the "password" prompt. Note: this method is not truly keyboard-interactive, and the adapter may not recognize all prompts supplied by the server. It should be used only when the SSHHost cannot be configured to authenticate the SSHUser via more easily automated methods such as Password or Public Key. |
GSSAPIWithMic | This allows the adapter to attempt Kerberos authentication using the GSSAPI-WITH-MIC scheme. The client will try Kerberos authentication using the value of SSHUser (single sign-on), or if SSHPassword is specified as well, it will try Kerberos authentication with alternate credentials. |
SSHCert Property (PowerShell Adapter)
The certificate to use for client authentication during the SSH handshake.
Data Type
CertificateRemarks
This property is used to assign a specific certificate for SSH client authentication.
This field is used to set a Private Key Certificate.
Private key certificates may be loaded from the registry, from files in PKCS#12 format, or from a PEM file format. If you click on the ellipses, a certificate selection dialog will open. To select a private key from the system registry, select the System Store tab or the User Store tab, and highlight the appropriate registry store. The list of certificates which have private keys will be shown below.
To select a private key certificate from a file in PKCS#12 format, select the PFX Store tab. The browse button can be used to examine the file system for PKCS#12 (.pfx or .p12) certificates. If you wish to examine the certificate, provide the password in the field provided and click on the Open button to examine the file store for certificates present. To load a certificate from PEM files, select the PEM tab. Like the PFX file selection, you can specify the password and click the Open button to examine the certificates in the PEM store, or you may paste any PEM data stored in memory.
Regardless of how you selected the certificate, once you hit the OK button, the adapter will attempt to verify that certificate selection. If successful, the subject of the certificate will be displayed in the property field. If the adapter was not able to verify the selection, a dialog box will appear instead detailing the verification error.
SSHCompressionAlgorithms Property (PowerShell Adapter)
A comma-separated list of compression algorithms allowed for this connection.
Data Type
String
Default Value
"none"
Remarks
This list is used for both directions: client to server and server to client. When negotiating algorithms, each side sends a list of all algorithms it supports or allows. The algorithm chosen for each direction is the first algorithm to appear in the sender's list that the receiver supports, so it is important to list multiple algorithms in preferential order. If no algorithm can be agreed upon, the adapter will raise an error and the connection will be aborted.
SSHCompressionAlgorithms must be set to a comma-separated list containing at least one of the following values:
zlib | Zlib compression is allowed for this connection. |
none | No compression is allowed for this connection. |
Timeout Property (PowerShell Adapter)
A timeout for the component.
Data Type
Integer
Default Value
60
Remarks
If the Timeout property is set to 0, all operations will run uninterrupted until successful completion, or an error condition is encountered.
If Timeout is set to a positive value, the adapter will wait for the operation to complete before returning control.
If Timeout expires, and the operation is not yet complete, the adapter fails with an error.
Please note that by default, all timeouts are inactivity timeouts, i.e. the timeout period is extended by Timeout seconds when data is successfully sent or received.
Optionally, the behavior of the adapter may be changed to absolute timeouts, i.e. the adapter will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.
This behavior is controlled by the AbsoluteTimeout configuration setting.
The default value for the Timeout property is 60 (seconds).
TransmitBatchMode Property (PowerShell Adapter)
How the transmitter processes batches.
Data Type
Enumeration
Possible Values
Parallel (0)
Serial (1)
Default Value
0
Remarks
This property controls how the transmitter processes message batches:
Parallel | The adapter will process however many batches the BizTalk Message Engine sends it.
The number of maximum concurrent batches may be controlled by the MaxThreads property. |
Serial | The adapter will queue batches from the BizTalk Message Engine and process them one at a time. |
This property can only be configured through the adapter's static handler property page in the BizTalk Server administration console.
This property is not available in the Receiver.
TransportLog Property (PowerShell Adapter)
Tells the component where and how to report information about its operations.
Data Type
LogRemarks
This is a Log type property which contains fields describing how and where the adapter will record information about its execution.
This property may be configured on the adapter's static handler property page in the BizTalk Server administration console.
URI Property (PowerShell Adapter)
The Uniform Resource Identifier (URI) of the send port or receive location.
Data Type
String
Default Value
""
Remarks
This property specifies a URI for the send port or receive location. Setting this property is optional.
By default the adapter will automatically generate a URI. You may choose to specify your own value here to be used in place of the generated URI.
If this value is specified it must begin with the correct prefix, as seen in the default value.
User Property (PowerShell Adapter)
The username to use when executing commands remotely.
Data Type
String
Default Value
""
Remarks
Specifies the username for authenticating when executing commands remotely. If using PowerShell V2 remoting, and User is not specified, the current user is used for authentication.
Variables Property (PowerShell Adapter)
Variables to add to the PowerShell Runspace before executing the command.
Data Type
String
Default Value
""
Remarks
You can pass arbitrary arguments to the PowerShell script to be executed by setting these Variables. The value consists of one or more lines, each one defining a "name=value" pair. Each pair will be written into the runspace as a variable named "$name".
Certificate Type
The digital certificate being used.
Remarks
This type describes the current digital certificate. The certificate may be a public or private key. The fields are used to identify or select certificates.
Fields
Store
String
Default Value: "MY"
The name of the certificate store for the client certificate.
The StoreType field specifies the type of the certificate store specified by Store. If the store is password protected, specify the password in StorePassword.
Store is used in conjunction with the Subject field in order to specify client certificates. If Store has a value, and Subject is set, a search for a certificate is initiated. Please refer to the Subject field for details.
Designations of certificate stores are platform-dependent.
The following are designations of the most common User and Machine certificate stores in Windows:
MY | A certificate store holding personal certificates with their associated private keys. |
CA | Certifying authority certificates. |
ROOT | Root certificates. |
SPC | Software publisher certificates. |
In Java, the certificate store normally is a file containing certificates and optional private keys.
When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).
If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.
StorePassword
String
Default Value: ""
If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
StoreType
CertStoreTypes
Default Value: 0
The type of certificate store for this certificate.
The adapter supports both public and private keys in a variety of formats. When the cstAuto value is used, the adapter will automatically determine the type. This field can take one of the following values:
0 (cstUser - default) | For Windows, this specifies that the certificate store is a certificate store owned by the current user.
Note: This store type is not available in Java. |
1 (cstMachine) | For Windows, this specifies that the certificate store is a machine store.
Note: This store type is not available in Java. |
2 (cstPFXFile) | The certificate store is the name of a PFX (PKCS#12) file containing certificates. |
3 (cstPFXBlob) | The certificate store is a string (binary or Base64-encoded) representing a certificate store in PFX (PKCS#12) format. |
4 (cstJKSFile) | The certificate store is the name of a Java Key Store (JKS) file containing certificates.
Note: This store type is only available in Java. |
5 (cstJKSBlob) | The certificate store is a string (binary or Base64-encoded) representing a certificate store in Java Key Store (JKS) format.
Note: this store type is only available in Java. |
6 (cstPEMKeyFile) | The certificate store is the name of a PEM-encoded file that contains a private key and an optional certificate. |
7 (cstPEMKeyBlob) | The certificate store is a string (binary or Base64-encoded) that contains a private key and an optional certificate. |
8 (cstPublicKeyFile) | The certificate store is the name of a file that contains a PEM- or DER-encoded public key certificate. |
9 (cstPublicKeyBlob) | The certificate store is a string (binary or Base64-encoded) that contains a PEM- or DER-encoded public key certificate. |
10 (cstSSHPublicKeyBlob) | The certificate store is a string (binary or Base64-encoded) that contains an SSH-style public key. |
11 (cstP7BFile) | The certificate store is the name of a PKCS#7 file containing certificates. |
12 (cstP7BBlob) | The certificate store is a string (binary) representing a certificate store in PKCS#7 format. |
13 (cstSSHPublicKeyFile) | The certificate store is the name of a file that contains an SSH-style public key. |
14 (cstPPKFile) | The certificate store is the name of a file that contains a PPK (PuTTY Private Key). |
15 (cstPPKBlob) | The certificate store is a string (binary) that contains a PPK (PuTTY Private Key). |
16 (cstXMLFile) | The certificate store is the name of a file that contains a certificate in XML format. |
17 (cstXMLBlob) | The certificate store is a string that contains a certificate in XML format. |
18 (cstJWKFile) | The certificate store is the name of a file that contains a JWK (JSON Web Key). |
19 (cstJWKBlob) | The certificate store is a string that contains a JWK (JSON Web Key). |
21 (cstBCFKSFile) | The certificate store is the name of a file that contains a BCFKS (Bouncy Castle FIPS Key Store).
Note: This store type is only available in Java and .NET. |
22 (cstBCFKSBlob) | The certificate store is a string (binary or Base64-encoded) representing a certificate store in BCFKS (Bouncy Castle FIPS Key Store) format.
Note: This store type is only available in Java and .NET. |
23 (cstPKCS11) | The certificate is present on a physical security key accessible via a PKCS#11 interface.
To use a security key, the necessary data must first be collected using the CERTMGR adapter. The ListStoreCertificates method may be called after setting CertStoreType to cstPKCS11, CertStorePassword to the PIN, and CertStore to the full path of the PKCS#11 DLL. The certificate information returned in the CertList event's CertEncoded parameter may be saved for later use. When using a certificate, pass the previously saved security key information as the Store and set StorePassword to the PIN. Code Example. SSH Authentication with Security Key:
|
99 (cstAuto) | The store type is automatically detected from the input data. This setting may be used with both public and private keys and can detect any of the supported formats automatically. |
Subject
String
Default Value: ""
The subject of the certificate used for client authentication.
When this property is set, a search is performed in the current certificate store certificate with matching subject.
If an exact match is not found, the store is searched for subjects containing the value of the property.
When setting the property to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US
Example (Searching with partial subject)
Control.CertSubject = "Test"
If a match is not found, the property is set to an empty string, and no certificate is selected.
The special value "*" picks a random certificate in the certificate store.
If a matching certificate is found, Subject is set to the full subject of the matching certificate.
Thumbprint
String (read-only)
Default Value: ""
The thumbprint of the certificate.
This field is used to specify the thumbprint of the certificate. When there are multiple certificates in the store that have the same subject, the thumbprint will be used to distinguish between them.
Constructors
Constructors are only relevant when configuring adapters in orchestrations.
public Certificate();
Creates a Certificate instance whose properties can be set.
public Certificate(string certificateFile);
Opens CertificateFile and reads out the contents as an X509 public key.
public Certificate(byte[] certificateData);
Parses CertificateData as an X509 public key.
public Certificate(CertStoreTypes certStoreType, string store, string storePassword, string subject);
CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store. After the store has been successfully opened, the constructor will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X509 certificate's subject Distinguished Name (DN).
public Certificate(CertStoreTypes certStoreType, string store, string storePassword, byte[] encoded);
CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store. After the store has been successfully opened, the constructor will load Encoded as an X509 certificate and search the opened store for a corresponding private key.
public Certificate(CertStoreTypes certStoreType, byte[] storeBlob, string storePassword, string subject);
CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a string (binary- or base64-encoded) containing the certificate store. StorePassword is the password used to protect the store. After the store has been successfully opened, the constructor will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X509 certificate's subject Distinguished Name (DN).
public Certificate(CertStoreTypes certStoreType, byte[] storeBlob, string storePassword, byte[] encoded);
CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a string (binary- or base64-encoded) containing the certificate store. StorePassword is the password used to protect the store. After the store has been successfully opened, the constructor will load Encoded as an X509 certificate and search the opened store for a corresponding private key.
Firewall Type
The firewall the component will connect through.
Remarks
When connecting through a firewall, this type is used to specify different properties of the firewall such as the firewall Host and the FirewallType.
Fields
AutoDetect
Boolean
Default Value: False
Tells the adapter whether or not to automatically detect and use firewall system settings, if available.
FirewallType
FirewallTypes
Default Value: 0
Determines the type of firewall to connect through. The applicable values are the following:
Host
String
Default Value: ""
Name or IP address of firewall (optional). If a Host is given, requested connections will be authenticated through the specified firewall when connecting.
If the Host field is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the Host field is set to the corresponding address. If the search is not successful, an error is returned.
Password
String
Default Value: ""
A password if authentication is to be used when connecting through the firewall. If Host is specified, the User and Password fields are used to connect and authenticate to the given firewall. If the authentication fails, a trappable error is fired.
Port
Integer
Default Value: 0
The TCP port for the firewall Host. See the description of the Host field for details.
Note that the Port is set automatically when FirewallType is set to a valid value. See the description of the FirewallType field for details.
User
String
Default Value: ""
A user name if authentication is to be used connecting through a firewall. If the Host is specified, the User and Password fields are used to connect and authenticate to the given Firewall. If the authentication fails, a trappable error is fired.
Constructors
Constructors are only relevant when configuring adapters in orchestrations.
public Firewall();
Log Type
A log where the component will record information about its operations.
Remarks
This describes how and where the adapter will record information describing its execution.
Fields
Location
String
Default Value: "Application"
This field describes the location where the logging information is to be written.
If the EventLog LogType has been chosen, this field must contain the name of the Event Log to which the information should be written. The default value for this field is "Application". If a value other than "Application" is set the computer must be restarted for the change to take effect. Note that the same event log must be used for all send ports and receive locations that use the same adapter.
If the File LogType has been chosen, this field must contain the location of the file to write logging information to on the file system.
The adapter also supports logging to files based on the current date and time. This allows for log files to be organized by days, months, or other intervals as specified. When specifying a log filename include a valid .NET date and time format string within the < and > characters. For instance C:\logs\sftp_<yyyyMMdd>.log or C:\logs\as2_<yyyyMMdd>T<hhmm>.log.
LogMode
LogModes
Default Value: 3
This field controls what information the adapter logs. The possible values have the following affect on the adapter's behavior:
Verbose | The adapter will report all information regarding the transport. |
Info | The adapter will report all major operations, as well as all warnings and errors. |
Warning | The adapter will report any conditions that could result in unpredictable behavior as well as errors. |
Error | The adapter will report all errors that prevent normal operations from completing. |
Fatal | The adapter will report only serious errors that cause the adapter to completely stop functioning. |
LogType
LogTypes
Default Value: 1
This property controls where the adapter will log the information. The possible values have the following affect on the adapter's behavior:
None | The adapter will not report any logging information. |
EventLog | The adapter will report all logging information to the event log. The specific event log must be defined in the Location field when this type is selected. |
File | The adapter will report all logging information to a file. The desired file must be specified in the Location field when this type has been selected. |
Constructors
Constructors are only relevant when configuring adapters in orchestrations.
public Log();
public Log(LogTypes logType, string location, LogModes logMode);
OAuthAuthorizationParam Type
This type holds details of the OAuth authorization.
Remarks
This type holds details of the OAuth authorization.
Fields
AuthorizationScopes
String
Default Value: ""
A space separated list of scopes as defined by the authorization server.
AuthorizationString
String
Default Value: ""
The OAuth Authorization string. This field holds the current OAuth authorization string. This is retrieved during the OAuth authorization process and is used to authenticate the request. This is a string like:
Bearer ya29.AHES6ZSZEJzATdZYjeihDn5W-VrXSsxEZu5p0pclxGdKKQ
CacheLocation
String
Default Value: ""
The location on disk of the OAuth Cache File.
This field specifies the location on disk of the OAuth cache file. This file holds OAuth credentials that may be automatically used during runtime and by other ports using the same provider. The adapter uses the data within the cache file to automatically refresh expired tokens at runtime. Do not alter the contents of the file directly.
One file for each provider is used by default. For instance for Box the value is:
%APPDATA%\nsoftware\CloudStorage BizTalk Adapter\BoxOAuthCache.txt
This value may be specified manually as well.
CallbackURL
String
Default Value: ""
The Callback URL used during OAuth authorization.
This field specifies the local URL to which the browser is redirected when initially performing authorization. When initially establishing Authorization set this value to the redirect URI that is registered for your application with the service provider. For instance "http://localhost:7777".
The adapter will parse this URL and start a small embedded web server on the specified port to receive the OAuth response from the provider during OAuth authorization.
This value is required to perform OAuth authorization.
ClientId
String
Default Value: ""
The id of the client assigned when registering the application.
This field holds the id of the client that was assigned when initially registering the application.
This value is required to perform OAuth authorization.
ClientSecret
String
Default Value: ""
The secret of the client assigned when registering the application.
This field holds the secret of the client that was assigned when initially registering the application.
This value is required to perform OAuth authorization.
ExpiresIn
Integer
Default Value: 0
The expiration time of the current OAuth authorization string.
This value is populated after OAuth authorization and holds the expiration time of the OAuth access token as reported by the service provider. This is used at runtime to calculate whether the token should be refreshed before attempting an operation. If the token is expired the adapter will automatically refresh the token. If the token is not expired the adapter will use the current token.
This value should not be set manually.
Note: Not all providers provide this value. For instance Dropbox access tokens never expire.
RefreshToken
String
Default Value: ""
The refresh token received from or sent to the authorization server.
This field holds the refresh token received during the initial OAuth authorization. It is used by the adapter to automatically request a new AuthorizationString when the current value expires.
ServerAuthURL
String
Default Value: ""
The URL of the authorization server.
ServerTokenURL
String
Default Value: ""
The URL of the token server.
ServiceProvider
String
Default Value: ""
The service provider to authenticate with.
This field defines the service provider. This is used when performing OAuth authorization. OAuth authorization is only applicable to some providers. If the provider does not support OAuth a warning will be displayed. Possible values when using the Cloud Storage adapter are:
- Amazon S3
- Azure Blob
- Azure File
- Backblaze B2
- Box.com
- Digital Ocean Spaces
- Dropbox
- Google Cloud Storage
- Google Drive
- Hadoop DFS
- IBM Cloud Object Storage
- Linode Object Storage
- Microsoft OneDrive
- Wasabi
- Gmail
- Other
TimeStamp
String
Default Value: "0"
The timestamp of the OAuth authorization string.
This field holds the timestamp of when the AuthorizationString was retrieved. This is used in conjunction with ExpiresIn to calculate if refreshing the token is required. For more details see ExpiresIn.
This value should not be set manually.
Constructors
Constructors are only relevant when configuring adapters in orchestrations.
public OAuthAuthorizationParam();
Proxy Type
The proxy the component will connect to.
Remarks
When connecting through a proxy, this type is used to specify different properties of the proxy such as the Server and the AuthScheme.
Fields
AuthScheme
ProxyAuthSchemes
Default Value: 0
Use the AuthScheme field to tell the adapter which type of authorization to perform when connecting to the proxy. This is only used when the User and Password fields are set.
AuthScheme should be set to authNone (3) when no authentication is expected.
By default, AuthScheme is authBasic (0), and if the User and Password fields are set, the component will attempt basic authentication. If AuthScheme is set to authDigest (1), digest authentication will be attempted instead.
If AuthScheme is set to authProprietary (2), then the authorization token will not be generated by the adapter. Look at the configuration file for the adapter being used to find more information about manually setting this token.
If AuthScheme is set to authNtlm (4), NTLM authentication will be used. This option is only available in the SSL package.
For security reasons, setting this property will clear the values of User and Password.
AutoDetect
Boolean
Default Value: False
Tells the adapter whether or not to automatically detect and use proxy system settings, if available.
Password
String
Default Value: ""
A password if authentication is to be used for the proxy.
If AuthScheme is set to Basic Authentication, the User and Password are Base64 encoded and the proxy authentication token will be generated in the form "Basic [encoded-user-password]".
If AuthScheme is set to Digest Authentication, the User and Password fields are used to respond to the Digest Authentication challenge from the server.
If AuthScheme is set to NTLM Authentication, the User and Password fields are used to authenticate through NTLM negotiation.
Port
Integer
Default Value: 80
The TCP port for the proxy Server (default 80). See the description of the Server field for details.
Server
String
Default Value: ""
If a proxy Server is given, then the HTTP request is sent to the proxy instead of the server otherwise specified.
If the Server field is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, the Server field is set to the corresponding address. If the search is not successful, an error is returned.
SSL
ProxySSLTypes
Default Value: 0
Determines when to use SSL for the connection to the proxy. The applicable values are the following:
psAutomatic (0) | Default setting. The connection to the Server is SSL-enabled for 'https' URL-s, and non SSL-enabled for other URL-s. |
psAlways (1) | The connection is always SSL-enabled. |
psNever (2) | The connection is not SSL-enabled. |
psTunnel (3) | The connection is through a tunneling (HTTP) proxy. |
User
String
Default Value: ""
A user name, if authentication is to be used for the proxy.
If AuthScheme is set to Basic Authentication, the User and Password are Base64 encoded and the proxy authentication token will be generated in the form "Basic [encoded-user-password]".
If AuthScheme is set to Digest Authentication, the User and Password fields are used to respond to the Digest Authentication challenge from the server.
If AuthScheme is set to NTLM Authentication, the User and Password fields are used to authenticate through NTLM negotiation.
Constructors
Constructors are only relevant when configuring adapters in orchestrations.
public Proxy();
public Proxy(string server, int port);
public Proxy(string server, int port, string user, string password);
Config Settings (PowerShell Adapter)
The adapter accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the adapter, access to these internal properties is provided through the Other property.PowerShell Config Settings
Example (for setting the threshold to 500 MB):
SSHComponent.Config("KeyRenegotiationThreshold=524288000")
SSHAcceptServerHostKeyFingerprint=0a:1b:2c:3d
At least one supported algorithm must appear in this list. The following encryption algorithms are supported by the component:
aes256-cbc | 256-bit AES encryption in CBC mode |
aes192-cbc | 192-bit AES encryption in CBC mode |
aes128-cbc | 128-bit AES encryption in CBC mode |
3des-cbc | 192-bit (3-key) triple DES encryption in CBC mode |
aes256-ctr | 256-bit AES encryption in CTR mode |
aes192-ctr | 192-bit AES encryption in CTR mode |
aes128-ctr | 128-bit AES encryption in CTR mode |
3des-ctr | 192-bit (3-key) triple DES encryption in CTR mode |
cast128-cbc | CAST-128 encryption |
blowfish-cbc | Blowfish encryption |
arcfour | ARC4 encryption |
arcfour128 | 128-bit ARC4 encryption |
arcfour256 | 256-bit ARC4 encryption |
aes256-gcm@openssh.com | 256-bit AES encryption in GCM mode. |
aes128-gcm@openssh.com | 128-bit AES encryption in GCM mode. |
The default value is "aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,arcfour256,arcfour128,arcfour,cast128-cbc,aes256-gcm@openssh.com,aes128-gcm@openssh.com".
- curve25519-sha256
- curve25519-sha256@libssh.org
- diffie-hellman-group1-sha1
- diffie-hellman-group14-sha1
- diffie-hellman-group14-sha256
- diffie-hellman-group16-sha512
- diffie-hellman-group18-sha512
- diffie-hellman-group-exchange-sha256
- diffie-hellman-group-exchange-sha1
- ecdh-sha2-nistp256
- ecdh-sha2-nistp384
- ecdh-sha2-nistp521
- gss-group14-sha256-toWM5Slw5Ew8Mqkay+al2g==
- gss-group16-sha512-toWM5Slw5Ew8Mqkay+al2g==
- gss-nistp256-sha256-toWM5Slw5Ew8Mqkay+al2g==
- gss-curve25519-sha256-toWM5Slw5Ew8Mqkay+al2g==
- gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g==
- gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==
- hmac-sha1
- hmac-md5
- hmac-sha1-96
- hmac-md5-96
- hmac-sha2-256
- hmac-sha2-256-96
- hmac-sha2-512
- hmac-sha2-512-96
- hmac-ripemd160
- hmac-ripemd160-96
- hmac-sha2-256-etm@openssh.com
- hmac-sha2-512-etm@openssh.com
- umac-64@openssh.com
- umac-64-etm@openssh.com
- umac-128@openssh.com
- umac-128-etm@openssh.com
This setting specifies a list of signature algorithms that may be used when authenticating to the server using public key authentication. This applies only when public key authentication is performed by the client.
The setting should be a comma separated list of algorithms. At runtime the adapter will evaluate the specified algorithms and if the algorithm is applicable to the certificate specified in SSHCert it will be used. If the algorithm is not applicable the adapter will evaluate the next algorithm. Possible values are:
- ssh-rsa
- rsa-sha2-256
- rsa-sha2-512
- ssh-dss
- ecdsa-sha2-nistp256
- ecdsa-sha2-nistp384
- ecdsa-sha2-nistp521
- ssh-ed25519
- x509v3-sign-rsa
- x509v3-sign-dss
The default value in Windows is ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519.
rsa-sha2-256 and rsa-sha2-512 notes
The adapter will query the server for supported algorithms when connecting. If the server indicates support for rsa-sha2-256 or rsa-sha2-512 and the algorithm is present in the list defined by this setting (as in the default value), that algorithm will be used instead of ssh-rsa even when ssh-rsa appears first in the list.
For the rsa-sha2-256 and rsa-sha2-512 algorithms to be automatically preferred the server must support the ext-info-c mechanism. In practice, older servers do not support this and in that case ssh-rsa will be used since it appears first in the list. Newer servers do support this mechanism and in that case rsa-sha2-256 or rsa-sha2-512 will be used even though it appears after ssh-rsa.
This behavior has been carefully designed to provide maximum compatibility while automatically using more secure algorithms when connecting to servers which support them.
Since both client and server must implement strict key exchange to effectively mitigate the Terrapin attack, the adapter provides options to further control the behavior in different scenarios. Possible values for this setting are:
0 | Disabled. Strict key exchange is not supported in the adapter. |
1 (default) | Enabled, but not enforced. This setting enables strict key exchange, but if the remote host does not support strict key exchange the connection is still allowed to continue. |
2 | Enabled, but reject affected algorithms if the remote host does not support strict key exchange. If the remote host supports strict key exchange all algorithms may be used. If the remote host does not support strict key exchange the connection will only continue if the selected encryption and MAC algorithms are not affected by the Terrapin attack. |
3 | Required. If the remote host does not support strict key exchange the connection will fail. |
General Config Settings
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the adapter initiate connections (or accept in the case of server adapters) only through that interface.
If the adapter is connected, the LocalHost configuration shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).
By default, this config is set to false.
Setting this configuration setting to True tells the adapter to use the internal implementation instead of using the system security libraries.
On Windows, this setting is set to False by default. On Linux/macOS, this setting is set to True by default.
If using the .NET Standard Library, this setting will be True on all platforms. The .NET Standard library does not support using the system security libraries.
Note: This setting is static. The value set is applicable to all adapters used in the application.
When this value is set, the product's system dynamic link library (DLL) is no longer required as a reference, as all unmanaged code is stored in that file.
Supported Macros
The adapter also supports the following Macros. These values are not case sensitive and would be supplied to a property in the form %MacroName%.