Get-EntraUserDirectReport

ユーザーの直属の部下を取得します。

構文

Default (既定)

Get-EntraUserDirectReport

    -UserId <String>
    [-All]
    [-Top <Int32>]
    [-Property <String[]>]
    [<CommonParameters>]

説明

Get-EntraUserDirectReport コマンドレットは、Microsoft Entra IDのユーザーの直属の部下を取得します。 指定 UserId パラメーターは、ユーザーの直属の部下を取得します。

例 1: ユーザーの直属の部下を取得する

Connect-Entra -Scopes 'User.Read', 'User.Read.All'
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' |
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType |
Format-Table -AutoSize
id                                    displayName     userPrincipalName           createdDateTime       accountEnabled  userType
--                                    -----------     -----------------           ---------------       --------------  --------
bbbbbbbb-1111-2222-3333-cccccccccccc  Christie Cline  ChristieC@Contoso.com       10/7/2024 12:32:25 AM  True           Member
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb  Isaiah Langer   IsaiahL@Contoso.com         10/7/2024 12:33:16 AM  True           Member

この例では、Microsoft Entra IDでユーザーの直属の部下を取得する方法を示します。

  • -UserId パラメーターは、ユーザーの ID (UserPrincipalName または UserId) を指定します。

例 2: すべての直属の部下を取得する

Connect-Entra -Scopes 'User.Read', 'User.Read.All'
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' -All |
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType |
Format-Table -AutoSize
id                                    displayName     userPrincipalName           createdDateTime       accountEnabled  userType
--                                    -----------     -----------------           ---------------       --------------  --------
bbbbbbbb-1111-2222-3333-cccccccccccc  Christie Cline  ChristieC@Contoso.com       10/7/2024 12:32:25 AM  True           Member
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb  Isaiah Langer   IsaiahL@Contoso.com         10/7/2024 12:33:16 AM  True           Member

この例では、Microsoft Entra IDでユーザーのすべての直属の部下を取得する方法を示します。

  • -UserId パラメーターは、ユーザーの ID (UserPrincipalName または UserId) を指定します。

例 3: 上位 2 つの直属の部下を取得する

Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' -Top 2 |
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType |
Format-Table -AutoSize
id                                    displayName     userPrincipalName           createdDateTime       accountEnabled  userType
--                                    -----------     -----------------           ---------------       --------------  --------
bbbbbbbb-1111-2222-3333-cccccccccccc  Christie Cline  ChristieC@Contoso.com       10/7/2024 12:32:25 AM  True           Member
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb  Isaiah Langer   IsaiahL@Contoso.com         10/7/2024 12:33:16 AM  True           Member

この例では、Microsoft Entra IDでユーザーの上位 5 つの直属の部下を取得する方法を示します。 -Limitのエイリアスとして-Topを使用できます。

  • -UserId パラメーターは、ユーザーの ID (UserPrincipalName または UserId) を指定します。

パラメーター

-All

すべてのページを一覧表示します。

パラメーターのプロパティ

型:System.Management.Automation.SwitchParameter
規定値:False
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Property

返されるプロパティを指定します。

パラメーターのプロパティ

型:

System.String[]

規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:Select

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Top

返されるレコードの最大数を指定します。

パラメーターのプロパティ

型:System.Int32
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:極限

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-UserId

Microsoft Entra IDのユーザーの UserPrincipalName または UserId の ID を指定します。

パラメーターのプロパティ

型:System.String
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:オブジェクト識別子, UPN, アイデンティティ, ユーザープリンシパルネーム

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:True
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

CommonParameters

このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。