---
title: Retrieves Service Filter Objects
slug: homologacao-atmosphere/retrieves-service-filter-objects
description: Learn how to use a PowerShell command to retrieve service conditions for firewall rules in the active repository. This document provides a summary of the command, including examples and returned values. Find out how to specify the policy storage for rule 
createdAt: 2022-07-25T17:44:41.000Z
---

## Resumo

- Recupera as condições de serviço associadas a todas as regras de firewall no repositório ativo. A execução desse cmdlet sem especificar o armazenamento de política recupera o armazenamento persistente.

## Parâmetros

| **Parâmetro**                                                                                                                                                                                                                                                                                     | **Tipo** | **Escolhas \| Valor Padrão**                                                                           | **Comentários**                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| policy\_store<br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado.<br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado. | string   | - PersistentStore<br />- ActiveStore<br />- RSOP<br />- SystemDefaults<br />- ConfigurableServiceStore | Especifica o armazenamento de política do qual recuperar as regras a serem recuperadas. Um repositório de políticas é um contêiner para a política de firewall e IPsec.<br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado. |

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

## Exemplos

```yaml
# Exemplo: Este exemplo obtém todas as máquinas virtuais no host da máquina virtual local.
tasks:
  powershell_command:
    server: "{{ server }}"
    port: "{{ input.port }}"
		ssl: "{{ input.ssl }}"
    username: "{{ username }}"
    password: "{{ password }}"
    show_errors: true
		show_warnings: true
    command: |
      Get-NetFirewallServiceFilter {{ input.policy_store }} | Format-Table -Property * | ConvertTo-Json
  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            |

