# 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. Installez le GitHub CLI.
   * Pour obtenir des instructions d’installation pour GitHub CLI, consultez le [dépôt GitHub CLI](https://github.com/cli/cli#installation).
   * Si vous avez GitHub CLI déjà installé, exécutez `gh --version` pour vous assurer que vous exécutez la version 2.4.0 ou ultérieure. Si vous avez une version antérieure, consultez le [GitHub CLI référentiel](https://github.com/cli/cli#installation) pour obtenir des instructions de mise à niveau.
1. Installez le ADO2GH extension.

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

1. La ADO2GH extension of the GitHub CLI est mise à jour chaque semaine. Pour être sûr d’utiliser la version la plus récente, mettez à jour l’extension.

    ```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. Définissez le personal access token comme variable d’environnement, en remplaçant TOKEN dans les commandes ci-dessous par le personal access token que vous avez enregistré ci-dessus.

   * Si vous utilisez le Terminal, utilisez la commande `export`.

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

   * Si vous utilisez PowerShell, utilisez la commande `$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] Si vous accordez le rôle de migration pour GHE.com, vous devez également inclure l’URL de l’API cible pour le sous-domaine de votre entreprise. Par exemple : `--target-api-url https://api.octocorp.ghe.com`.