---
title: Create User Account
slug: homologacao-atmosphere/create-user-account
description: Learn how to create a user account with and without a password using PowerShell commands in this comprehensive document. Discover the essential parameters, like the user's name and description, and explore examples that showcase the output, error, and war
createdAt: 2022-07-26T12:29:09.000Z
---

## Resumo

- Cria uma conta de usuário.

## Parâmetros

| **Parâmetro**                                                                                                                                                                                                                                                                            | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**                                                                                                                                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name<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   |                              | Nome dado ao usuário.<br />string<br />- Any ***(default)***<br />- Domain<br />- NotApplicable<br />- Public<br />- Private<br />Service Group a ser filtrado. |
| description                                                                                                                                                                                                                                                                              | string   |                              | Descrição informativa do usuário.                                                                                                                               |

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

## Exemplos

```yaml
- name: Create a user account without password
  powershell_command:
    server: "{{ input.server }}"
		port: "{{ input.port }}"
		ssl: "{{ input.ssl }}"
    username: "{{ input.username }}"
    password: "{{ input.password }}"
		show_errors: "{{ input.show_errors }}"
		show_warnings: "{{ input.show_warnings }}"
    command: |
      New-LocalUser -Name "{{ input.user }}" -Description "{{ input.description }}" -NoPassword | ConvertTo-Json
  register: result


  - name: Create a user account with a password
  powershell_command:
    server: "{{ input.server }}"
		port: "{{ input.port }}"
		ssl: "{{ input.ssl }}"
    username: "{{ input.username }}"
    password: "{{ input.password }}"
		show_errors: "{{ input.show_errors }}"
		show_warnings: "{{ input.show_warnings }}"
    command: |
      New-LocalUser -Name "{{ input.name }}" -Password ${{ input.password }} -FullName "{{ input.fullname }}" -Description "{{ input.description }}" | ConvertTo-Json
  register: result
```

## 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            |

