> For the complete documentation index, see [llms.txt](https://docs.linuxcontrolcenter.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.linuxcontrolcenter.com.br/en/unmanaged-hosts/unmanaged-windows.md).

# Microsoft Windows

## Requirements

* Linux Control Center = 2.10.X or higher.<br>
* Access Credentials to the Windows Host with the necessary permissions.<br>
* WinRM Enabled on the Windows Host.<br>

## Overview

The Linux Control Center **Unmanaged Hosts** functionality allows the execution of Scripts on Microsoft Windows Hosts through WinRM (Windows Remote Management) on Hosts that are not being managed by the LCC.

This functionality uses Windows Credentials, Unmanaged Hosts and Unmanaged Host Groups registered in the Console. The LCC offers a history of executions through simplified Logs.

* Configuration flow to execute Scripts on an Unmanaged Microsoft Windows Host.

1. [Unmanaged Host Windows Registration](#unmanaged-host-windows-registration)
2. [Windows Credential Registration](#windows-credential-registration)
3. [PowerShell Script Registration](#powershell-script-registration)
4. [Script Execution with Workflow](#executing-a-powershell-script-on-unmanaged-windows-hosts)

## Objective

This document aims to demonstrate step by step how to register an *Unmanaged Host*, *Unmanaged Windows Credentials* and *PowerShell Script* to execute the *Custom Scripts Quick Windows* Action.

### Unmanaged Host Windows Registration

1. Access the LCC and click on **Unmanaged Hosts**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-52ecdda62a02517f789a5ffe434f65a9cf58af91%2Fbotao_unmanaged_hosts_dashboard.png?alt=media)
2. Click **Unmanaged Inventory**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-a2ec79058accde1068d23207cc8511691af7ee42%2Fbotao_unmanaged_inventory.png?alt=media)
3. Click **Create** and fill in the following fields;

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-9d756fbcdd60b82cc5385f4e5f98260c9ff23fdd%2Fbotao_create_unmanaged_host.png?alt=media)

**Name**: Name to identify the Host.\
**Host Type**: Select the *Windows* option.\
**Address**: Enter the Windows Host IP address with dots. Ex: 192.168.0.25\
**Port**: Enter the Host's WinRM port<br>

1. Click **Save**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-fc05a002af280511b946454d9f704d43e42ca5ad%2Fbotao_save_unmanaged_host.png?alt=media)

### Windows Credential Registration

* This credential will be responsible for accessing the Host and executing the desired *Script*.

1. Access the **Unmanaged Hosts** screen.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-52ecdda62a02517f789a5ffe434f65a9cf58af91%2Fbotao_unmanaged_hosts_dashboard.png?alt=media)
2. Click **Host Credentials**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-15029dbf13441d53f31a8800051fccca22842474%2Fbotao_hosts_credentials.png?alt=media)
3. Click **Windows Credentials**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-1734297e1e41d34f8586c3925f47c9fb2119dc17%2Fbotao_windows_credentials.png?alt=media)
4. Click **Create**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-72c4daa530f19ffeaec6f4e2a3a8baed2f1c5c62%2Fbotao_create_unmanaged_credentials.png?alt=media)
5. Fill in the requested fields and click **Save**.

**Name**: Name to identify the credential\
**Username**: User to run the Script\
**Password**: User password to run the Script<br>

```
![](/pt-br/images/unmanaged_hosts/windows/create_windows/botao_save_credential.png)
```

### PowerShell Script Registration

1. Access the **Unmanaged Hosts** screen.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-52ecdda62a02517f789a5ffe434f65a9cf58af91%2Fbotao_unmanaged_hosts_dashboard.png?alt=media)
2. Click on **Scripts**.

* This screen is the same as the Hosts screen on the left side menu, where all the scripts registered in LCC are located, both for Windows and Linux.

1. Click on **Create**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-f4580c2a230931fa62c0952f325fc144433d7b09%2Fbotao_create_script.png?alt=media)
2. Fill in the following fields;

**Name**: Name to identify the Script.\
**Host Type**: Select the *Windows* option.<br>

```
![](/pt-br/images/unmanaged_hosts/windows/create_windows/campos_script_type_e_name.png)
```

1. Click on **Upload File** and upload the Windows Script.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-6fbc129cc8bb7ca93f19b61a583e37709fbc5c26%2Fscript_uploaded.png?alt=media)
2. Click on **Save**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-108f5020ec1928ede52affee1eb528ea48ace29f%2Fbotao_save_script.png?alt=media)

### Executing a PowerShell Script on Unmanaged Windows Hosts

1. Click on **Workflow** on the left sidebar.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-f301dfe8ab8a954bc747fe46be1a9c99c65a5d78%2Fworkflow_dashboard.png?alt=media)
2. Click **Create**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-7dc013a82c79b272a620e40863eb88613c3e143e%2Fbotao_create.png?alt=media)
3. Enter a name for the Workflow in the **Name** field.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-0c85429a0c02587b7b7b0c8b77e38a5a276291d5%2Fcampo_name_workflow.png?alt=media)
4. Click **Start New Workflow**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-a76a256c531e3dd82747715ba3f703fd06c73b81%2Fbotao_start_new_workflow.png?alt=media)
5. Choose the **Custom Script Quick Windows** *Action* in the *Action* field.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-35e852755a80cd7eea6104501ff982e66407aab5%2Facao_quick_windows.png?alt=media)
6. Fill in the fields as instructed below;

* **Script**: Choose the PowerShell Script that will be executed.<br>
* **Unmanaged Host**: Choose the Unmanaged Host Windows on which the Script will be executed.<br>
* It is also possible to execute the Script in an *Unmanaged Group*.

  ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-fc350d521107b9ca09b052655cf68ce2bcdf8d3d%2Fcampos_workflow_preenchido.png?alt=media)

1. Click **Create**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-d4d89d0d9873f85cf87cd643ec233038aff41fa7%2Fbotao_create_workflow.png?alt=media)
2. Click **Save**

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-8be0968d32518d9a2be287dca56afbe30f68fca2%2Fbotao_save_workflow.png?alt=media)
3. Click **Actions** of the *Workflow* you created and click **Run**.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-376c5d0b9fdefa0b574d1e236021bb4c233d48ed%2Frun_workflow.png?alt=media)
4. Click **Agree** to run the *Workflow*.

   ![](https://1620115297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtZm19HsLxuDm2GumYKEz%2Fuploads%2Fgit-blob-a1eedeeee24e2b416cd8092367bbe4266c763668%2Fagree_run_workflow.png?alt=media)
