Fortinet black logo

Microsoft WinRM

WinRM v1.0.0

1.0.0
Copy Link
Copy Doc ID 0d737d1b-55fd-41e9-ac4e-2a43706a5817:1

About the connector

Windows Remote Management (WinRM) enables you to remotely perform various management tasks, such as running batch scripts, powershell scripts, and uploading files.

WinRM connector is for the WinRM service that allows you to invoke commands on targeted Windows machines from any machine that can run Python.

This document provides information about the WinRM connector, which provides an interface to connect with a Windows server and remotely execute commands on a WinRM server using FortiSOAR™ playbooks. Add the WinRM connector as a step in FortiSOAR™ playbooks and perform automated operations, such as executing commands, Powershell (PS) commands, and scripts, and uploading a script file to a windows machine.

Version information

Connector Version: 1.0.0

Compatibility with FortiSOAR™ Versions: 4.9.0.0-708 and later

Installing the connector

For the procedure to install a connector, click here.

Prerequisites to configuring the connector

  • You must have the username and password of the Windows server you want to connect to and perform automated operations.
  • To access the FortiSOAR™ UI, ensure that port 443 is open through the firewall for the FortiSOAR™ instance.

Configuring the connector

For the procedure to configure a connector, click here.

Configuration parameters

In FortiSOAR™, on the Connectors page, select the WinRM connector and click Configure to configure the following parameters:

Parameter Description
Username Username used to connect to the Windows server to which you will connect and perform automated operations.
Password Password used to connect to the Windows server to which you will connect and perform automated operations.
Verify SSL Specifies whether the SSL certificate for the server is to be verified or not.
By default, this option is set as True.

Actions supported by the connector

The following automated operations can be included in playbooks and you can also use the annotations to access operations from FortiSOAR™ release 4.10.0 onwards:

Function Description Annotation and Category
Run Command Runs the command you specify on the windows machine you have specified. execute_command
Miscellaneous
Run Powershell Command Runs the Powershell command you specify on the windows machine you have specified. execute_command
Miscellaneous
Run Script Runs the script you specify on the windows machine you have specified. execute_command
Miscellaneous
Upload File To Endpoint Uploads the provided script file to the location you specify on the windows machine you have specified. upload_file_to_endpoint
Miscellaneous

operation: Run Command

Input parameters

Parameter Description
IP Address IP address of the windows machine on which you want to execute the command.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
Default port for http is 5985 and the default port for https is 5986.
Command Command that you want to execute remotely.

Output

The JSON output contains the output of the command, which is dependent on the command that you execute.

Following image displays a sample output:

Sample output of the Run Command operation

operation: Run Powershell Command

Input parameters

Parameter Description
IP Address IP address of the windows machine on which you want to execute the command.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
The default port for http is 5985 and the default port for https is 5986.
Command Powershell command that you want to execute remotely.

Output

The JSON output contains the output of the Powershell command, which is dependent on the command that you execute.

Following image displays a sample output:

Sample output of the Run PowershellCommand operation

operation: Run Script

Input parameters

Parameter Description
IP Address IP address of the windows machine on which you want to execute the script.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
The default port for http is 5985 and the default port for https is 5986.
Attachment IRI Attachment IRI of the script file which is used to submit files directly from the FortiSOAR™ Attachments module to the Windows server.

Output

The JSON output contains the output of the script, which is dependent on the script that you execute.

Following image displays a sample output:

Sample output of the Run Script operation

operation: Upload File To Endpoint

Input parameters

Parameter Description
IP Address IP address of the windows machine to which you want to upload the PS script.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
Default port for http is 5985 and the default port for https is 5986.
Absolute File Path Complete location on the windows machine where you want to save the script file.
Attachment IRI Attachment IRI of the script file which is used to upload files directly from the FortiSOAR™ Attachments module to the Windows server.

Output

The JSON output contains a Success message and the location of where the script is uploaded if the script file is uploaded successfully or an Error message containing the reason for failure.

Following image displays a sample output:

Sample output of the Upload File To Endpoint operation

Included playbooks

The Sample-WinRM-1.0.0 playbook collection comes bundled with the WinRM connector. This playbook contains steps using which you can perform all supported actions. You can see the bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the WinRM connector.

  • Run Command
  • Run Powershell Command
  • Run Script
  • Upload File To Endpoint

Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection, since the sample playbook collection gets deleted during connector upgrade and delete.

Previous
Next

About the connector

Windows Remote Management (WinRM) enables you to remotely perform various management tasks, such as running batch scripts, powershell scripts, and uploading files.

WinRM connector is for the WinRM service that allows you to invoke commands on targeted Windows machines from any machine that can run Python.

This document provides information about the WinRM connector, which provides an interface to connect with a Windows server and remotely execute commands on a WinRM server using FortiSOAR™ playbooks. Add the WinRM connector as a step in FortiSOAR™ playbooks and perform automated operations, such as executing commands, Powershell (PS) commands, and scripts, and uploading a script file to a windows machine.

Version information

Connector Version: 1.0.0

Compatibility with FortiSOAR™ Versions: 4.9.0.0-708 and later

Installing the connector

For the procedure to install a connector, click here.

Prerequisites to configuring the connector

Configuring the connector

For the procedure to configure a connector, click here.

Configuration parameters

In FortiSOAR™, on the Connectors page, select the WinRM connector and click Configure to configure the following parameters:

Parameter Description
Username Username used to connect to the Windows server to which you will connect and perform automated operations.
Password Password used to connect to the Windows server to which you will connect and perform automated operations.
Verify SSL Specifies whether the SSL certificate for the server is to be verified or not.
By default, this option is set as True.

Actions supported by the connector

The following automated operations can be included in playbooks and you can also use the annotations to access operations from FortiSOAR™ release 4.10.0 onwards:

Function Description Annotation and Category
Run Command Runs the command you specify on the windows machine you have specified. execute_command
Miscellaneous
Run Powershell Command Runs the Powershell command you specify on the windows machine you have specified. execute_command
Miscellaneous
Run Script Runs the script you specify on the windows machine you have specified. execute_command
Miscellaneous
Upload File To Endpoint Uploads the provided script file to the location you specify on the windows machine you have specified. upload_file_to_endpoint
Miscellaneous

operation: Run Command

Input parameters

Parameter Description
IP Address IP address of the windows machine on which you want to execute the command.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
Default port for http is 5985 and the default port for https is 5986.
Command Command that you want to execute remotely.

Output

The JSON output contains the output of the command, which is dependent on the command that you execute.

Following image displays a sample output:

Sample output of the Run Command operation

operation: Run Powershell Command

Input parameters

Parameter Description
IP Address IP address of the windows machine on which you want to execute the command.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
The default port for http is 5985 and the default port for https is 5986.
Command Powershell command that you want to execute remotely.

Output

The JSON output contains the output of the Powershell command, which is dependent on the command that you execute.

Following image displays a sample output:

Sample output of the Run PowershellCommand operation

operation: Run Script

Input parameters

Parameter Description
IP Address IP address of the windows machine on which you want to execute the script.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
The default port for http is 5985 and the default port for https is 5986.
Attachment IRI Attachment IRI of the script file which is used to submit files directly from the FortiSOAR™ Attachments module to the Windows server.

Output

The JSON output contains the output of the script, which is dependent on the script that you execute.

Following image displays a sample output:

Sample output of the Run Script operation

operation: Upload File To Endpoint

Input parameters

Parameter Description
IP Address IP address of the windows machine to which you want to upload the PS script.
Protocol Protocol used for the remote connection, choose between http or https.
Port Port number used for connecting to the Windows server.
Default port for http is 5985 and the default port for https is 5986.
Absolute File Path Complete location on the windows machine where you want to save the script file.
Attachment IRI Attachment IRI of the script file which is used to upload files directly from the FortiSOAR™ Attachments module to the Windows server.

Output

The JSON output contains a Success message and the location of where the script is uploaded if the script file is uploaded successfully or an Error message containing the reason for failure.

Following image displays a sample output:

Sample output of the Upload File To Endpoint operation

Included playbooks

The Sample-WinRM-1.0.0 playbook collection comes bundled with the WinRM connector. This playbook contains steps using which you can perform all supported actions. You can see the bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the WinRM connector.

Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection, since the sample playbook collection gets deleted during connector upgrade and delete.

Previous
Next