ユーザーの一覧のライセンスステータスを取得しようとしています。私はライセンスの状況に基づいて何かをします。属性クラスpowershellを取得する方法
例えばライセンスユーザ出力:
Get-AzureADUser -ObjectId "[email protected]" | fl
DeletionTimestamp :
ObjectId :
ObjectType : User
AccountEnabled : True
AssignedLicenses : {class AssignedLicense {
DisabledPlans: System.Collections.Generic.List`1[System.String]
SkuId: 6fd2c87f-b296-42f0-b197-1e91e994b900
}
}
非ライセンスユーザ出力:
Get-AzureADUser -ObjectId "[email protected]" | fl
DeletionTimestamp :
ObjectId :
ObjectType : User
AccountEnabled : True
AssignedLicenses : {}
私はAzureADのPowerShellでそれを取得する方法がわかりません。 AssignedLicenses
属性内からSkuIdを取得するにはどうすればよいですか?
#for licence user
if($AzureADUser.SkuId -eq '6fd2c87f-b296-42f0-b197-1e91e994b900')
{
do something...
}
#for non-licence user
elseif($AzureADUser.AssignedLicenses -eq $null)
{
do something...
}
最終更新日:
Get-AzureADUser -ObjectId "[email protected]" | Select-Object -ExpandProperty AssignedLicenses
DisabledPlans SkuId
------------- -----
{} 6fd2c87f-b296-42f0-b197-1e91e994b900
非ライセンスユーザー:
Get-AzureADUser -ObjectId "[email protected]" | Select-Object -ExpandProperty AssignedLicenses
何もあなたが直接このようSKUIDにアクセスすることができ
私はコマンドをテストすることはできませんが、まずGet-AzureADUser -ObjectId "[email protected]"を使ってプロパティ 'AssignedLicenses'を展開する必要があると言います。 Select-Object -ExpandProperty AssignedLicenses'を選択します。 – Manu
@ManuP私は自分の質問を更新しました。最後の更新セクションが表示されます。 – Arbelac