web-dev-qa-db-ja.com

Get-AzureADUser [-Filter <String>]コマンドの例

コマンド:Get-AzureADUser [-Filter]コマンド

msdnはパラメータ-Filterを言いますoDatav3.0フィルターステートメントを指定します。このパラメーターは、返されるオブジェクトを制御します。

azureモジュールv1コマンドと同じ結果を取得するようにフィルターを設定する方法

Get-MsolUser -All| Where-Object {$_.isLicensed -eq "True"}| Select-Object UserPrincipalName -ExpandProperty Licenses|Select-Object UserPrincipalName -ExpandProperty ServiceStatus|Where-Object {$_.ProvisioningStatus -eq "Success" -and $_.ServicePlan.ServiceName -like "MCO*"}|select UserPrincipalName -Unique

フィルターを設定する適切な例を見つけるために至る所を検索しましたが、できず、ここに行き着きました。基本的に、Azureモジュールv1コマンドをAzureモジュールv2コマンドに変換しようとしています。

3
Sameer

これはそれをするようです

Get-AzureADUser -All $true|select UserPrincipalName -ExpandProperty AssignedPlans|Where-Object {$_.CapabilityStatus -eq "Enabled" -and $_.Service -eq "MicrosoftCommunicationsOnline"} |select UserPrincipalName -Unique
1
Sameer