Edit

Share via


Set-EntraDirSyncConfiguration

Modifies the directory synchronization settings.

Syntax

Default (Default)

Set-EntraDirSyncConfiguration

    -AccidentalDeletionThreshold <UInt32>
    [-Force]
    [-TenantId <Guid>]
    [<CommonParameters>]

Description

The Set-EntraDirSyncConfiguration cmdlet modifies the directory synchronization settings.

In delegated scenarios, the signed-in user must have either a supported Microsoft Entra role or a custom role with the necessary permissions. The minimum roles required for this operation are:

  • Global Administrator

Examples

Example 1: Set directory synchronization settings

Connect-Entra -Scopes 'OnPremDirectorySynchronization.ReadWrite.All'
Set-EntraDirSyncConfiguration -AccidentalDeletionThreshold 600 -Force

This command sets directory synchronization settings.

  • -AccidentalDeletionThreshold Specifies the accidental deletion prevention configuration for a tenant.
  • -Force Forces the command to run without asking for user confirmation.

Example 2: Set directory synchronization settings for a Tenant

Connect-Entra -Scopes 'OnPremDirectorySynchronization.ReadWrite.All'
$tenantID = (Get-EntraContext).TenantId
Set-EntraDirSyncConfiguration -AccidentalDeletionThreshold 600 -TenantId $tenantID -Force

This command sets directory synchronization settings.

  • -AccidentalDeletionThreshold Specifies the accidental deletion prevention configuration for a tenant.
  • -Force Forces the command to run without asking for user confirmation.
  • -TenantId Specifies the unique ID of the tenant.

Parameters

-AccidentalDeletionThreshold

Specifies the accidental deletion prevention configuration for a tenant.

Parameter properties

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

Parameter sets

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

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
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

-TenantId

The unique ID of the tenant on which to perform the operation. This parameter provides compatibility with Azure AD and MSOnline for partner scenarios. TenantID is the signed-in user's tenant ID.

Parameter properties

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

Parameter sets

SetAccidentalDeletionThreshold
Position:Named
Mandatory:False
Value from pipeline:False
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.

Inputs

System.UInt32

System.Guid

Outputs

System.Object

Notes