Get-EntraContactDirectReport

Get the direct reports for a contact.

Syntax

Get-EntraContactDirectReport
   -OrgContactId <String>
   [-All]
   [-Top <Int32>]
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraContactDirectReport cmdlet gets the direct reports for a contact.

Examples

Example 1: Get the direct reports of a contact

Connect-Entra -Scopes 'OrgContact.Read.All'
$Contact = Get-EntraBetaContact -Top 1
Get-EntraContactDirectReport -OrgContactId $Contact.ObjectId

This example shows how to retrieve direct reports for an organizational contact.

You can use the command Get-EntraBetaContact to get organizational contact.

  • -OrgContactId parameter specifies the contact Id.

Example 2: Get all direct reports of a contact

Connect-Entra -Scopes 'OrgContact.Read.All'
$Contact = Get-EntraBetaContact -Top 1
Get-EntraContactDirectReport -OrgContactId $Contact.ObjectId -All

This example shows how to retrieve all direct reports for an organizational contact.

  • -OrgContactId parameter specifies the contact Id.

Example 3: Get top two direct reports of a contact

Connect-Entra -Scopes 'OrgContact.Read.All'
$Contact = Get-EntraBetaContact -Top 1
Get-EntraContactDirectReport -OrgContactId $Contact.ObjectId -Top 2

This example shows how to retrieve top two direct reports for an organizational contact.

  • -OrgContactId parameter specifies the contact Id.

Parameters

-All

List all pages.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OrgContactId

Specifies the ID of a contact in Microsoft Entra ID.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Property

Specifies properties to be returned.

Type:System.String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Top

Specifies the maximum number of records to return.

Type:System.Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False