3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Microsoft] macOSからMicrosoft 365 (Office 365) を管理する

Posted at

Microsoft 365 (Office 365) の管理にはPowerShellを使うのが定番です。
PowerShell Core 7.0も出ているし、そろそろmacからもできるかなぁと思いましたが、どうもまだできない様子です。

代わりに、Microsoft Pattern and Practice teamが作っているNodeでできたツールを使ってみます。

あらかじめ必要なもの

  • Nodeまたは Nodenv

はじめかた

npmを使ってインストールします。

npm install --global @pnp/office365-cli

Nodenvを使っている場合は、rehashもします。

nodenv rehash

o365コマンドが使えるようになりました。

使い方

o365 help とするとヘルプが表示されます。

$ o365 help

  Office 365 CLI v2.9.0
  Manage Microsoft Office 365 and SharePoint Framework projects on any platform

  Commands:

    help [command...]  Provides help for a given command.
    exit|quit          Exits application.
    version            Shows the current version of the CLI
    login [options]    Log in to Office 365
    logout [options]   Log out from Office 365
    status [options]   Shows Office 365 login status

  Command Groups:

    aad *              36 sub-commands.
    accesstoken *      1 sub-command.
    cli *              7 sub-commands.
    consent *          1 sub-command.
    flow *             12 sub-commands.
    graph *            5 sub-commands.
    onedrive *         7 sub-commands.
    outlook *          13 sub-commands.
    pa *               5 sub-commands.
    planner *          1 sub-command.
    skype *            3 sub-commands.
    spfx *             3 sub-commands.
    spo *              216 sub-commands.
    teams *            42 sub-commands.
    tenant *           5 sub-commands.
    util *             1 sub-command.
    yammer *           17 sub-commands.

いくつもあるサブコマンドのうち、省略形でわからないものをあげます。

  • aad - Azure ActiveDirectory
  • pa - Power Automate
  • spfx - SharePoint Framework
  • spo - SharePoint Online

ログインする

最初にログインします。

o365 loginとすると、https://microsoft.com/devicelogin へアクセスし、デバイスコードを入力するように促されます。

別途ブラウザで https://microsoft.com/devicelogin へアクセスし、表示されているデバイスコードを入力します。

アプリケーションへのアクセス許可を求められるので許可します。

よくある(?)ユースケース

PowerShell でよくやっていたユースケースがo365 CLIでどうなるのか調べてみました。

テナント(ディレクトリ)の切り替え

できない(?)

ユーザの追加

できないようです。

スケジュールのアクセス権変更

できないようです。

感想

まだこれからのようです。

リンク

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?