Fortinet Document Library

Version:


Table of Contents

Microsoft WinRM

1.0.1
Copy Link

About the connector

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

Microsoft 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 Microsoft WinRM connector, which provides an interface to connect with a Windows server and remotely execute commands on a Microsoft WinRM server using FortiSOAR™playbooks. Add the Microsoft 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.1

FortiSOAR™Versions Tested on: 4.11.0-1161

Authored By: Fortinet

Certified: Yes

Release Notes for version 1.0.1

Following enhancements have been made to the Microsoft WinRM Connector in version 1.0.1:

  • Name of connector updated from WinRM Connector to Microsoft WinRM Connector.
  • Added the Convert to JSON input parameter to the Run Powershell Command action.

Installing the connector

All connectors provided by FortiSOAR™are delivered using a FortiSOAR™repository. Therefore, you must set up your FortiSOAR™repository and use the yum command to install connectors:

yum install cyops-connector-microsoft-winrm

For the detailed 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 run a Powershell Command action, you must have Powershell version 3.0 and later installed on your instance.
  • 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 CyOPs™, on the Connectors page, select the Microsoft 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:

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.
Convert to JSON Select this option to convert the command output to the JSON format.  
By default, this is set to True.
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:

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:

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:

Included playbooks

The Sample - Microsoft WinRM - 1.0.1 playbook collection comes bundled with the Microsoft 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 Microsoft 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.

 

 

About the connector

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

Microsoft 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 Microsoft WinRM connector, which provides an interface to connect with a Windows server and remotely execute commands on a Microsoft WinRM server using FortiSOAR™playbooks. Add the Microsoft 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.1

FortiSOAR™Versions Tested on: 4.11.0-1161

Authored By: Fortinet

Certified: Yes

Release Notes for version 1.0.1

Following enhancements have been made to the Microsoft WinRM Connector in version 1.0.1:

Installing the connector

All connectors provided by FortiSOAR™are delivered using a FortiSOAR™repository. Therefore, you must set up your FortiSOAR™repository and use the yum command to install connectors:

yum install cyops-connector-microsoft-winrm

For the detailed 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 CyOPs™, on the Connectors page, select the Microsoft 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:

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.
Convert to JSON Select this option to convert the command output to the JSON format.  
By default, this is set to True.
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:

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:

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:

Included playbooks

The Sample - Microsoft WinRM - 1.0.1 playbook collection comes bundled with the Microsoft 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 Microsoft 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.