Set-MsolDirSyncEnabled

Turns directory synchronization on or off for a company.

Syntax

Set-MsolDirSyncEnabled
   -EnableDirSync <Boolean>
   [-Force]
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Set-MsolDirSyncEnabled cmdlet turns directory synchronization on or off for a company.

Important

It may take up to 72 hours to complete deactivation once you have disabled DirSync through this cmdlet. The time depends on the number of objects that are in your cloud service subscription account. You cannot cancel the disable action. It will need to complete before you can take any other action, including re-enabling of DirSync. If you choose to re-enable DirSync, a full synchronization of your synced objects will happen. This may take a considerable time depending on the number of objects in your Active Directory.

Note

If you disable DirSync and you decide to re-enable it, and you have enabled the BlockCloudObjectTakeoverThroughHardMatch feature, OnPrem to cloud object takeover/update for all objects mastered in the Active Directory will be blocked. If this is the case and you want to resume syncing Active Directory mastered objects with Azure AD, set BlockCloudObjectTakeoverThroughHardMatch feature to false. You can read more about the DirSync features in this article.

Examples

Example 1: Turn on directory synchronization

PS C:\> Set-MsolDirSyncEnabled -EnableDirsync $True

This command turns on directory synchronization for a company.

Parameters

-EnableDirSync

Specifies whether to turn on directory synchronization on for your company.

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

-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False