0
0

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 3 years have passed since last update.

Powershell で Azure ActiveDirectory を管理する時はバージョンに気を付けましょう

0
Posted at

Azure ActiveDirectory のユーザ管理を Powershell を使って行う場合には、Powershell のバージョン、az モジュールのバージョンアップをちゃんと確認してからにしましょう。

バージョンが低いまだだと、使えると思った機能が使えない、オプション名が変わっていてエラーがでるなどのハマりどころがあります。
(ハマったのでこんな記事を書いているんですが)

Powershell のバージョン

Powershell は 7.x 系をインストールしましょう。5.1 系はスキップできるならスキップします。

7.x 系であれば、Windows 以外にも Mac、Linux などで使用することができます。どんな環境でも、同一の操作で Azure AD の管理作業ができるメリットは意外に大きいです。

現時点での最新は、7.2.2 です。サポートしている環境については、次のリンク先から確認できます。

バージョン確認方法

Powershell のバージョンチェック方法
PS> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      7.2.0
PSEdition                      Core
GitCommitId                    7.2.0
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

インストール方法

各OS用にインストールファイルが用意されています。

Windows だと、Microsoft Update からのインストールも可能ですので、組織で管理されている場合やインストール対象 PC が多い場合は Microsoft Update を使うのも一つだと思います。

az モジュールのバージョン

az モジュールですが、7.4 から大幅に強化されました。それ以前の 6.6 だと MSOnline モジュールを併用しないと設定できない項目も多く不便だったのですが、7.4 からはオプションが強化され、az モジュールだけで細かな項目も設定ができるようになりました。
さらに現在は 7.5 が公開されています。特別な理由がなければ、7.5 をインストールしましょう。

バージョン確認方法

az モジュールのバージョンチェック方法
PS> Get-InstallModle -Name az
Version              Name          Repository           Description
-------              ----          ----------           -----------
7.5.0                Az            PSGallery            Microsoft Azure PowerShell - Cmdlets to 

インストール方法

インストール先のコンピュータの管理権限があれば、次のコマンドでインストールができます。

azモジュールのインストール
PS> Install-Module -Name Az -Repository PSGallery -Force

もし管理権限がなければ、Scope オプションを付けて自分だけ利用できるようにする方法もあります。

azモジュールのインストール(自分のみ)
PS> Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

az コマンドのリファレンス

az コマンドも、Azure の機能アップに伴って更新されていますので、リファレンスで機能チェックしておきましょう。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?