Edit

Share via


Set-EntraDirSyncConfiguration

Modifies the directory synchronization settings.

Syntax

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.

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

-Force

Forces the command to run without asking for user confirmation.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters: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.

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

Inputs

System.UInt32

System.Guid

Outputs

System.Object

Notes