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

Microsoft365で特定ライセンスのユーザー一覧を作成する

Posted at

skuidを取得しないといけません。

Connect-MsolService
Get-MsolAccountSku

この組み合わせではライセンスの使用量しかわからないです。

Connect-MgGraph
Get-MgSubscribedSku

この組み合わせで skuidがわかります。
Graphの公式はこちら

Get-MgSubscribedSku | Select-Object SkuPartNumber,ConsumedUnits,SkuId

が現実的かと思います。

$skuid = "777779e8-3d26-4r66-acdc-c3bo815ld0y4"
Get-MgUser -Filter "assignedLicenses/any(x:x/skuId eq $skuid )" -ConsistencyLevel eventual -CountVariable licensedUserCount -All

これで$skuidにセットされたskuidのライセンスが割り振られたユーザーの一覧が出てきます。

ちなみに、ライセンスの付与は

Set-MgUserLicense -UserId $userID -AddLicenses @{SkuId = $skuid} -RemoveLicenses @()

こんな感じだそうです。

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