Home
%3CLINGO-SUB%20id%3D%22lingo-sub-887043%22%20slang%3D%22en-US%22%3EPowerShell%20Basics%3A%20How%20to%20Force%20AzureAD%20Connect%20to%20Sync%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-887043%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20every%20organization%2C%20the%20possibility%20of%20role%20changes%20or%20change%20of%20contact%20information%20can%20occur%20quite%20frequently.%20%3CSTRONG%3E%3CA%20title%3D%22What%20is%20AzureAD%20Connect%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fwhatis-azure-ad-connect%3FWT.mc_id%3DITOPSTALK-docs-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzureAD%20Connect%3C%2FA%3E%3C%2FSTRONG%3E%26nbsp%3Bis%20a%20great%20tool%20that%20allows%20administrators%20to%20make%20said%20updates%20either%20on-premises%20or%20in%20cloud%20and%20will%20sync%20all%20changes%20accordingly.%20It%20can%20take%20up%20to%2030%20minutes%20for%20Azure%20Active%20Directory%20to%20update%20these%20changes%20when%20these%20changes%20are%20applied%20on%20the%20on-premises%20Active%20Directory%20instance%20and%20vice-versa%20via%20AzureAD%20Connect.%20It%20can%20also%20take%20up%20to%20an%20additional%2030%20minutes%20to%20then%20sync%20changes%20with%20Office%20365.%20This%20post%20will%20detail%20steps%20to%20force%20AzureAD%20Connect%20to%20sync%20on%20command%20when%20required%20via%20PowerShell%20to%20combat%20the%20delay.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELets%20begin.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ERun%20PowerShell%3CBR%20%2F%3E%26nbsp%3B%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F131872i5A755AA2CF8E7946%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22How_To_Unlock_A_User_In_Active_Directory_via_PowerShell_001.png%22%20title%3D%22How_To_Unlock_A_User_In_Active_Directory_via_PowerShell_001.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ERun%20PowerShell%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ERun%20the%20following%20command%20to%20install%20the%20AzureAD%20Sync%20module%3A%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CPRE%3EImport-Module%20ADSync%3C%2FPRE%3E%0A%3C%2FLI%3E%0A%3CLI%3ENext%20lets%20review%20the%20current%20intervals%20AzureAD%20Connect%20uses%20to%20sync%20by%20running%20the%20following%20command.%3CBR%20%2F%3E%26nbsp%3B%0A%3CPRE%3EGet-ADSyncScheduler%3C%2FPRE%3E%0A%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%20The%20report%20should%20show%20intervals%20of%2030%20minute%20syncs%20and%20a%20sync%20policy%20type%20of%20Delta.%20A%20sync%20policy%20type%20of%20Initial%20is%20usually%20shown%20after%20AzureAD%20Connect's%20initial%20sync%20but%20can%20also%20be%20forced%20as%20detailed%20in%20the%20next%20step.%3CBR%20%2F%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ENow%20run%20the%20following%20command%20to%20initialize%20the%20AzureAD%20Sync%20immediately.%3CBR%20%2F%3E%26nbsp%3B%0A%3CPRE%3EStart-ADSyncSyncCycle%20-PolicyType%20Delta%3C%2FPRE%3E%0A%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%20This%20will%20only%20sync%20current%20changes.%26nbsp%3B%20Run%20the%20following%20command%20to%20force%20a%20complete%20sync%20but%20note%20that%20the%20length%20of%20sync%20time%20would%20be%20greatly%20increased.%3CBR%20%2F%3E%26nbsp%3B%3CBR%20%2F%3E%0A%3CPRE%3EStart-ADSyncSyncCycle%20-PolicyType%20Initial%3C%2FPRE%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EOther%20customized%20commands%20can%20be%20applied%20to%20AzureAD%20Connect%20to%20conduct%20specific%20synchronization%20tasks.%26nbsp%3B%20These%20additional%20commands%20are%20documented%20here%3A%26nbsp%3B%3CA%20title%3D%22Azure%20AD%20Connect%20sync%3A%20Understand%20and%20customize%20synchronization%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fhow-to-connect-sync-whatis%3FWT.mc_id%3DITOPSTALK-docs-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20AD%20Connect%20sync%3A%20Understand%20and%20customize%20synchronization%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-887043%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20every%20organization%2C%20the%20possibility%20of%20role%20changes%20or%20change%20of%20contact%20information%20can%20occur%20quite%20frequently.%20%3CSTRONG%3E%3CA%20title%3D%22What%20is%20AzureAD%20Connect%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fhybrid%2Fwhatis-azure-ad-connect%3FWT.mc_id%3DITOPSTALK-docs-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzureAD%20Connect%3C%2FA%3E%3C%2FSTRONG%3E%26nbsp%3Bis%20a%20great%20tool%20that%20allows%20administrators%20to%20make%20said%20updates%20either%20on-premises%20or%20in%20cloud%20and%20will%20sync%20all%20changes%20accordingly.%20It%20can%20take%20up%20to%2030%20minutes%20for%20Azure%20Active%20Directory%20to%20update%20these%20changes%20when%20these%20changes%20are%20applied%20on%20the%20on-premises%20Active%20Directory%20instance%20and%20vice-versa%20via%20AzureAD%20Connect.%20It%20can%20also%20take%20up%20to%20an%20additional%2030%20minutes%20to%20then%20sync%20changes%20with%20Office%20365.%20This%20post%20will%20detail%20steps%20to%20force%20AzureAD%20Connect%20to%20sync%20on%20command%20when%20required%20via%20PowerShell%20to%20combat%20the%20delay.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134944iD72B3B0B8F4E0886%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22PowerShell_Basics.jpg%22%20title%3D%22PowerShell_Basics.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-887043%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAnthony%20Bartolo%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

In every organization, the possibility of role changes or change of contact information can occur quite frequently. AzureAD Connect is a great tool that allows administrators to make said updates either on-premises or in cloud and will sync all changes accordingly. It can take up to 30 minutes for Azure Active Directory to update these changes when these changes are applied on the on-premises Active Directory instance and vice-versa via AzureAD Connect. It can also take up to an additional 30 minutes to then sync changes with Office 365. This post will detail steps to force AzureAD Connect to sync on command when required via PowerShell to combat the delay.

   

Lets begin.

   

  1. Run PowerShell
     
    How_To_Unlock_A_User_In_Active_Directory_via_PowerShell_001.pngRun PowerShell
     
  2. Run the following command to install the AzureAD Sync module:
     
    Import-Module ADSync
  3. Next lets review the current intervals AzureAD Connect uses to sync by running the following command.
     
    Get-ADSyncScheduler
    NOTE: The report should show intervals of 30 minute syncs and a sync policy type of Delta. A sync policy type of Initial is usually shown after AzureAD Connect's initial sync but can also be forced as detailed in the next step.
     
  4. Now run the following command to initialize the AzureAD Sync immediately.
     
    Start-ADSyncSyncCycle -PolicyType Delta
    NOTE: This will only sync current changes.  Run the following command to force a complete sync but note that the length of sync time would be greatly increased.
     
    Start-ADSyncSyncCycle -PolicyType Initial

Other customized commands can be applied to AzureAD Connect to conduct specific synchronization tasks.  These additional commands are documented here: Azure AD Connect sync: Understand and customize synchronization.