Edit

Share via


Get-EntraObjectSetting

Gets an object setting.

Syntax

GetQuery (Default)

Get-EntraObjectSetting

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

GetById

Get-EntraObjectSetting

    -Id <String>
    -TargetType <String>
    -TargetObjectId <String>
    [-All]
    [<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. You can use -Limit as an alias for -Top.

  • -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.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specifies the ID of a settings object.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetById
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Property

Specifies properties to be returned.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Select

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TargetObjectId

Specifies the ID of the target object.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-TargetType

Specifies the target type.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Top

Specifies the maximum number of records to return.

Parameter properties

Type:System.Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Limit

Parameter sets

GetQuery
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.