Get-EntraObjectSetting

Gets an object setting.

Syntax

Get-EntraObjectSetting
   [-Top <Int32>]
   [-All]
   -TargetType <String>
   -TargetObjectId <String>
   [<CommonParameters>]
Get-EntraObjectSetting
   -Id <String>
   [-All]
   -TargetType <String>
   -TargetObjectId <String>
   [<CommonParameters>]

Description

The Get-EntraObjectSetting cmdlet retrieves an object setting from Microsoft Entra ID.

Examples

Example 1: Retrieve object setting from Microsoft Entra ID

Connect-Entra -Scopes 'Directory.Read.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id

Id                                   DisplayName         TemplateId
--                                   -----------         ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Group.Unified.Guest 22cc22cc-dd33-ee44-ff55-66aa66aa66aa

This command retrieves object setting from Microsoft Entra ID.

  • -TargetType Parameter specifies the target type.
  • -TargetObjectId Parameter specifies the ID of the target object.

Example 2: Retrieve a specific object setting from Microsoft Entra ID

Connect-Entra -Scopes 'Directory.Read.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Sales and Marketing'"
$setting = Get-EntraObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id | Where-Object {$_.displayName -eq 'Group.Unified.Guest'}
Get-EntraObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id -Id $setting.Id

Id                                   DisplayName         TemplateId
--                                   -----------         ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Group.Unified.Guest 22cc22cc-dd33-ee44-ff55-66aa66aa66aa

This command retrieves Specific object setting from Microsoft Entra ID.

  • -TargetType Parameter specifies the target type.
  • -TargetObjectId Parameter specifies the ID of the target object.
  • -Id Parameter specifies the ID of a settings object.

Example 3: Retrieve top one object setting from Microsoft Entra ID

Connect-Entra -Scopes 'Directory.Read.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id -Top 1

Id                                   DisplayName         TemplateId
--                                   -----------         ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Group.Unified.Guest 22cc22cc-dd33-ee44-ff55-66aa66aa66aa

This command retrieves top one object setting from Microsoft Entra ID.

  • -TargetType Parameter specifies the target type.
  • -TargetObjectId Parameter specifies the ID of the target object.

Example 4: Retrieve all object setting from Microsoft Entra ID

Connect-Entra -Scopes 'Directory.Read.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Sales and Marketing'"
Get-EntraObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id -All

Id                                   DisplayName         TemplateId
--                                   -----------         ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Group.Unified.Guest 22cc22cc-dd33-ee44-ff55-66aa66aa66aa

This command retrieves all records of object setting from Microsoft Entra ID.

  • -TargetType Parameter specifies the target type.
  • -TargetObjectId Parameter specifies the ID of the target object.

Example 5: Retrieve user object settings

Connect-Entra -Scopes 'Directory.Read.All'
$user = Get-EntraUser -UserId 'AdeleV@Contoso.com'
Get-EntraObjectSetting -TargetType 'Users' -TargetObjectId $user.Id

Id ContributionToContentDiscoveryAsOrganizationDisabled ContributionToContentDiscoveryDisabled
-- ---------------------------------------------------- --------------------------------------
   False                                                False

This command retrieves user object setting.

  • -TargetType Parameter specifies the user target type.
  • -TargetObjectId Parameter specifies the ID of the user.

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

-Id

Specifies the ID of a settings object.

Type:System.String
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

-TargetObjectId

Specifies the ID of the target object.

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

-TargetType

Specifies the target type.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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