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: Once you have disabled dirsync through this cmdlet it may take 72 hours for deactivation to be completed. 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 have disabled DirSync and then decide to re-enable DirSync, and if you had previously enabled the DirSync feature BlockCloudObjectTakeoverThroughHardMatch, OnPrem to cloud object takeover/update will be blocked for all objects which were mastered in Active Directory before. If this is the case and you want to resume syncing Active Directory mastered obejcts with Azure AD then you will need to 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
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
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
Accept pipeline input:True
Accept wildcard characters:False