# 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. GitHub CLIをインストールします。
   * GitHub CLI のインストール手順については、[GitHub CLI リポジトリ](https://github.com/cli/cli#installation)を参照してください。
   * GitHub CLIが既にインストールされている場合は、`gh --version`を実行して、バージョン 2.4.0 以降を実行していることを確認します。 古いバージョンをお持ちの場合は、 [GitHub CLI リポジトリ](https://github.com/cli/cli#installation) にアクセスしてアップグレード手順を確認してください。
1. ADO2GH extensionをインストールします。

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

1. ADO2GH extension of the GitHub CLIは毎週更新されます。 最新バージョンを確実に使うため、拡張機能を更新してください。

    ```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. personal access token を環境変数として設定します。次のコマンドの TOKEN は、上で記録した personal access token に置き換えます。

   * ターミナルを使っている場合は、`export` コマンドを使います。

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

   * PowerShell を使っている場合は、`$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] 
   GHE.comの移行者ロールを付与する場合は、企業のサブドメインのターゲット API URL も含める必要があります。 (例: `--target-api-url https://api.octocorp.ghe.com`)。