---
title: Get Firewall Rules From Group
slug: homologacao-atmosphere/get-firewall-rules-from-group
description: Learn how to retrieve firewall rules from a specific group using a PowerShell script. This document provides a summary of the script, including the parameters it takes, such as the group and service filters. Discover how the PowerShell Command module is u
createdAt: 2022-07-06T18:24:06.000Z
---

## Resumo

- Obtém todas as regras de firewall de um grupo específico.

## Parâmetros

| **Parâmetro** | **Tipo** | **Escolhas \| Valor Padrão**                                                          | **Comentários**               |
| ------------- | -------- | ------------------------------------------------------------------------------------- | ----------------------------- |
| group         | string   |                                                                                       | Grupo a ser filtrado.         |
| service       | string   | - Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private | Service Group a ser filtrado. |

Utiliza parâmetros do módulo [Powershell Command](https://docs.simonops.com/homologacao-atmosphere/powershell-command).

## Exemplos

```yaml
tasks:
  powershell_command:
    server: "{{ server }}"
    port: "{{ input.port }}"
		ssl: "{{ input.ssl }}"
    username: "{{ username }}"
    password: "{{ password }}"
    show_errors: true
		show_warnings: true
    command: |
      Get-NetFirewallRule -Group "{{ input.group }}" | Get-NetFirewallServiceFilter -Service {{ input.service }} 
  register: result
- debug:
    msg: |
      {{ result.output }}
      {{ result.had_errors }}
      {{ result.output_errors }}
      {{ result.output_warnings }}
```

## Valores retornados

| **Chave**        | **Tipo** | **Retornado quando** | **Descrição**              |
| ---------------- | -------- | -------------------- | -------------------------- |
| output           | string   | Sempre               | Saída da execução          |
| had\_errors      | boolean  | Sempre               | Se teve erros              |
| output\_errors   | string   | Sempre               | Erros de saída da execução |
| output\_warnings | string   | Sempre               | Avisos de saída            |

