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 1 year has passed since last update.

Microsoft Graph で Get-MsolAccountSku ライクな出力結果をだす

Posted at

はじめに

2022年6月30日以降、MSOnline Powershell のライセンスを操作するコマンドが廃止されたため
自家製Office365関連ライセンス割り当てスクリプトをMicrosoft Graphで書き直したのだが、テナントのライセンスの使用状況を出力する新コマンドget-MgSubscribedSkuが従来のより非常に見づらい且つわかりづらかったので、パイプとSelectで旧コマンドGet-MsolAccountSkuライクの出力結果を出せるようにしてみた。

以下は従来(MSOnline Powershell)の。現在のライセンス使用本数と空き状況がわかる。
image.png

以下は get-MgSubscribedsku (Microsoft Graph)。
ライセンスがID表示だったり、ライセンス保有数もわからないためこれだけだと正直参考にならない、、
image.png

Get-MsolAccountSku ライクにする

コマンド

get-MgSubscribedSku | Select -Property Sku*, ConsumedUnits -ExpandProperty PrepaidUnits | select SkuPartNumber, Enabled, ConsumedUnits

出力結果

image.png

select と パイプ だらけでもっとスマートにしたがったが、ExpandProperty で展開しないと各種フィールドを select で抽出できなかった。

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?