# Granting the migrator role

The migrator role gives a user or team the ability to run migrations on behalf of an organization.

To allow someone other than an organization owner to run a migration or download migration logs, you can grant the migrator role to a user or team.

To grant the migrator role using the CLI, you can use the ADO2GH extension of the GitHub CLI.

1. Instale os GitHub CLI.
   * Para obter instruções de instalação para GitHub CLI, veja o [repositório GitHub CLI](https://github.com/cli/cli#installation).
   * Se você já tiver GitHub CLI instalado, execute `gh --version` para garantir que esteja executando a versão 2.4.0 ou mais recente. Se você tiver uma versão mais antiga, visite o [GitHub CLI repositório](https://github.com/cli/cli#installation) para obter instruções de atualização.
1. Instale os ADO2GH extension.

   ```shell copy
   gh extension install github/gh-ado2gh
   ```

1. O ADO2GH extension of the GitHub CLI é atualizado semanalmente. Para garantir que você esteja usando a última versão, atualize a extensão.

    ```shell copy
    gh extension upgrade github/gh-ado2gh
    ```

1. On GitHub, create and record a personal access token that has the `admin:org` scope.
1. Defina o personal access token como uma variável de ambiente, substituindo TOKEN nos comandos abaixo pelos personal access token que você registrou acima.

   * Se você estiver usando o Terminal, use o comando `export`.

      ```shell copy
      export GH_PAT="TOKEN"
      ```

   * Se você estiver usando o PowerShell, use o comando `$env`.

      ```shell copy
      $env:GH_PAT="TOKEN"
      ```
1. Use the `gh ado2gh grant-migrator-role` command, replacing ORGANIZATION with the organization you want to grant the migrator role for, ACTOR with the user or team name, and TYPE with `USER` or `TEAM`.

   ```shell copy
   gh ado2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPE
   ```

   >[!NOTE] Se você estiver concedendo a função de migrador, GHE.comtambém deverá incluir a URL de API de destino para o subdomínio da sua empresa. Por exemplo: `--target-api-url https://api.octocorp.ghe.com`.